Optimizing Apache Server

Hi,
https://www.linode.com/docs/guides/hosting-a-website-ubuntu-18-04/ this guide is giving the instruction for 2GB Linode.

"These guidelines are designed to optimize Apache for a Linode 2GB, but you can use this information for any size Linode. These values are based on the amount of memory available. If you have a Linode 4GB, multiply all of the values by 2 and use those numbers for your settings."

My linode is 1gb but in future probably i will upgrade it to 2gb. How should i optimize it now? For 1 gb or for 2gb?

So should i divide the values below to two for my 1 gb linode?

StartServers 4
MinSpareServers 20
MaxSpareServers 40
MaxClients 200
MaxRequestsPerChild 4500

Thank you.

3 Replies

So should i divide the values below to two for my 1 gb linode?
 
StartServers 4
MinSpareServers 20
MaxSpareServers 40
MaxClients 200
MaxRequestsPerChild 4500

I would just leave them the way they are and see if your nanode starts thrashing with your normal workload.

Which mpm are you using? If the answer is prefork, I would revisit that decision first.

-- sw

It is prefork. So what is your advice about the values now stevewi?

I would use the event or worker MPMs. Instead of processes (which are fairly heavyweight), they use threads. If you used, say, the event MPM, your nanode could handle this workload quite easily.

One thing about event and worker MPMs though… you can't use mod_php with them (mod_php is not thread-safe). You have to set up php-fpm and use that to handle php code. php-fpm is multi-threaded as well so, if you're workload is mostly php apps, you can segment it into different thread pools even further.

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct