✓ Solved

Optimization help for a Nanode 1GB

Hi there,

I am running a small Nanode 1GB here at Linode and would love to count with your optimization help.

Currently I host only one domain in that server, with just a few visitors, and I am using Apache and Virtual Hosts.

The website runs WordPress, I am using Apache's MPM (Prefork) and have deactivated KeepAlive.

My Prefork's configuration are below:

<IfModule mpm_prefork_module>
       StartServers              4
       MinSpareServers          10
       MaxSpareServers          25
       MaxRequestWorkers        50
       MaxConnectionsPerChild 2000
</IfModule>

Despite the site be very small, I noticed a high RAM usage. Now, for example, the server is using around 586 MB of RAM, while Apache is using around 396 MB and MySQL around 150 MB.

Well, I am really not a expert, and would like to optimize things here.

So I would love to count with your help, if possible.

5 Replies

✓ Best Answer

  1. Stop using mod-php and move your PHP interpreter to php-fpm (with multiple threads).

  2. Stop using mpm-prefork & use one of the multi-threaded MPMs — mpm-event or mpm-worker.

  3. Use a managed database.

— sw

Hi,

Thank you very much.

I'll check everything you suggested. :)

Hi again,

I am having some problems while trying to disable mpm-prefork.

I disable the dependency required (php8.1) but when I enable it again mpm-prefork is enabled automatically without I even typing the command. And from now on I can´t enable mpm-worker. Why this happens?

I have already edited /etc/apache2/apache2.conf and added the necessary lines regarding mpm_worker.

And, if I try to disable php8.1 followed by mpm-prefork it works. I get to enable mpm-worker after that. But now I can´t enable Apache, because of this error: "Job for apache2.service failed because the control process exited with error code."

Well, I obtain the below errors, also:

sudo a2enmod php8.1
Considering dependency mpm_prefork for php8.1:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
ERROR: Module mpm_worker is enabled - cannot proceed due to conflicts. It needs to be disabled first!
ERROR: Could not enable dependency mpm_prefork for php8.1, aborting

It seems something is "obliging" me to use mpm-prefork.

Can you give me one more help here, please?

You need to UNINSTALL mod-php (however it is you do that) and INSTALL php-fpm.

I answered your question in

https://www.linode.com/community/questions/23835/installed-and-activated-php-fpm-and-mpm_event-but-still-starting-prefork-automat

-- sw

Great, thank you very much.

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