0

I have a web app, having 2 tiers: wordpress as frontend and MySQL as backend.

The frontend is deployed using Helm chart, however the backend is deployed using Operator.

Since my webapp receives a lot of traffic, i would like to implement horizental pod autosacling (HPA).

My Question: Where can i define HPA: in frontend part (i.e: wordpress level) ? in backend part (i.e: MySQL level) ? or both ?

Thank you for your help!

Mohamed
  • 239
  • 1
  • 4
  • 17
  • 1
    Additional MySQL information request, please. RAM size, # cores, any SSD or NVME devices on MySQL Host server? Post on pastebin.com and share the links. From your SSH login root, Text results of: A) SELECT COUNT(*) FROM information_schema.tables; B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; E) STATUS; not SHOW STATUS, just STATUS; G) SHOW ENGINE INNODB STATUS; H) SELECT name, count FROM information_schema.innodb_metrics ORDER BY name; for backend server workload tuning analysis to provide suggestions. – Wilson Hauck Jun 10 '22 at 16:41

1 Answers1

1

You probably can't usefully set up HPA on the database. MySQL and PostgreSQL are usually single nodes, or if they have multiple nodes, they run in an active/standby mode, so adding nodes won't necessarily add capacity. (Even with a clustered database, there can be practical problems with setting up HPA around scale-in.)

You can set up HPA on the application. It's helpful to understand what the limiting factor on your application actually is: if you send enough load that it starts being slow or failing requests, is it starved for CPU time, out of memory, or waiting on the database? That would affect what parameters you'd want to set on the HPA.

One realistic situation is that your application does some database queries, which take the bulk of the time, and then very quickly renders the data to HTML or JSON. In this situation it will be hard to take advantage of HPA: the single-node database is hard to scale, and even if you scale up the application pods, you'll still be blocked on database queries.

David Maze
  • 130,717
  • 29
  • 175
  • 215