Question

Can we determine which server is good based on apache status?

Posted February 6, 2021 259 views
ApacheDigitalOcean Droplets

i have 2 server with 4GB and 2 CPU. is it possible to determine which server better than the other via apache status?
i use both server for same application and use CF loadbalance.

i want to destroy one but i wonder which one i should destroy.
my website is some kind of e-commerce website..

please help me to choose and your analyst as why i should destroy that server..

Here is apache status image
https://prnt.sc/yjev4j

in my opinion. i should destroy server A because the response time 3x longer than server B

Server A serve 60% of client
Server B serve 40%

and if i build new server, which MPM i should use?
imo prefork is better for my kind of website because server B using prefork and have shorter time request while higher CPU load.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi @yggitteam,

Since you are using a load balancer you can’t really tell which one is performing better in my opinion. Having said that, what you can do is optimize the one that you wish to use and then remove the other one.

You mentioned MPMs, a website really performs differently, in speed and everything depending on the MPM. What I usually like to use is MPM Event with PHP-FPM installed and OPcache enabled.

  • Prefork: Each child process handles one connection at a time. This is the default mode for Apache.

  • Worker: It uses multiple child processes with many threads each.

  • Event: This MPM was designed to allow more requests to be served simultaneously by passing off some processing work to supporting threads and freeing up the main threads to work on new requests.

Let’s talk some facts, MPM Prefork is an old MPM and it’s quickly being replaced by both Worker and Event.:

  • The default configuration for Apache and PHP in Linux systems is to use the prefork MPM with an embedded PHP interpreter. This is a very robust configuration but it means that Apache needs to spawn a separate process for every simultaneous request it wants to serve. Because every child process loads a PHP interpreter and associated libraries, this configuration takes a significant amount of memory.

MPM Event

  • On high-traffic websites, an alternate MPM (the event MPM) is preferable because it has the ability to serve a large amount of requests while maintaining low memory usage. It does so by using threads to serve requests. It retains some of the stability of a process-based server by keeping multiple processes available, each with many threads so a thread potentially misbehaving would only affect all the other threads in the same process.

Basically, the best go to combination is MPM Event with PHP-FPM. That’s what everything is using, from cPanel servers to Plesk ones.

So, all in all, it doesn’t matter which server you’ll use but how you optimize it.

Regards,
KFSys

  • no, i mean with that configuration..
    1 using prefork
    1 using worker

    based on apache status, without changing anything..
    which one i must destroy?

    • I would go for destroying the prefork one. This Apache status will not show you the whole picture so if you want to go without knowing all the variables, I’ll recommend going with the MPM Worker for the future.