0

background is that we're running REST API servers with nginx+php-fpm, with haproxy as the load balancer. issue is that we're getting 502 issues sometimes when on heavy loading.

my question is that, which one would be better?

  • 16 servers with 4 GB 2 core
  • 8 servers with 8 GB 4 core

the price is the same, so which one would work better? more servers (16 servers)? or stronger servers (8 servers)?

Thanks

Fayland Lam
  • 103
  • 1
  • 6
  • What happens behind the REST API? Are things written primarily with scale-up or scale-out in mind? Are client sessions stateful or stateless? Are they long or short? How do the performance stats for the load balancer look? Does it seem to struggle? Do you have a database solution behind the load balancer and web servers? Does it struggle to keep up? – Mikael H Aug 11 '19 at 07:10
  • stateless, short, database is fine. just too many requests and some servers are not responding well (with 502) while some servers are fine. do we have a general answer or it depends on the code? just assume that there are same number of requests to php-fpm. – Fayland Lam Aug 11 '19 at 08:08
  • It always depends on the code, but what you describe sounds like it could scale out. Were you thinking of investing in server hardware? Is it an option to run a cloud-based proof of concept to try your options out in a limited run before committing to an investment? – Mikael H Aug 11 '19 at 09:17
  • In my point of View is, that more Servers could Serve more request in parallel but the question is, if the 4gb are enough, this can only answered by yourself – djdomi Aug 11 '19 at 10:35
  • for 4gb, with less max_children. for 8gb, we can double the max_children for php-fpm. so generally it's the same? no big difference? We're using linode server btw. – Fayland Lam Aug 11 '19 at 15:32

0 Answers0