1

I have an Linux/Debian server with Intel i7 CPU with 4 cores and 8 threads. When I run my heavy duty Apache/PHP job it uses 1 thread, and when I run concurrent Apache/PHP jobs they each use their own thread.

So, if I want to be prepared for high traffic, is it simply a matter of maximizing the number of cores (by choosing other CPUs) to be able to handle more concurrent jobs, provided it has enough memory and that the database/filesystem doesn't pose extra challenges?

I have tried running 8 and 10 jobs concurrently and it used all threads and CPU utilization was mostly 100% (but ran flawlessly), so it seems like the theory is not completely off - but is there something else that could bust this linear thinking?

Alternatively I could go with a load balanced system with multiple servers but I wonder how far I can get with a single server.

PS. Apache/PHP is using mod_php with thread safety disabled, therefore it uses Prefork MPM. Not sure I dare use Worker MPM as I'm uncertain about thread safety...

PSS. Also, I'm not necessarily looking for better performance, mainly just be able to handle higher traffic/more concurrent jobs.

1

From what you describe (100% CPU utilization), your application seems CPU bound. So adding more CPU cores or moving to a machine with faster cores will likely improve your performance.

Many cloud providers charge you only a few cents each hour to rent powerful virtual machines with many CPU cores and lots of RAM. Just go ahead and test on 16 or 32 cores to find out, how your performance scales with number of CPUs/cores.

And yes, I recommend increasing the number of cores in your system, first, before you increase the number of systems.

1

There always is a scalability limit, and it could be any component of the system.

If you had a nice linear increase in throughput, and response time was not too terrible, CPU is not currently your limiting factor. Keep testing with more CPUs. Think big, you can rent very large VMs from various clouds. You might start seeing NUMA effects when the VM is larger than one CPU socket.

Ideally, throughput just stops increasing because it hits some other bottleneck, but it might also degrade rapidly. Only way to find out is to test.

There are non-scalability reasons to use multiple load balanced backends, including high availability.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.