Question

Very high ram use in Ubuntu compare to debian

  • Posted August 11, 2013

hi. I had a Debian 7x64 server that had some security issues and because I’m more familiar with Ubuntu turned to Ubuntu 12.04x64. both my droplets was 512 and served one WordPress site with apache/mysql

In Debian my ram use was basically between 130 and 350 mb and never passed 400mb In Ubuntu my rame use is between 179 and 470 and even swap use more ram

is this normal? because the website is new and only have 100 500 visitor/view a day.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Thanks, I was getting 500s using tcp that went away after switching to a socket connection.

@forestmars+docker: It does not <em>need</em> to listen on a socket however it is recommended to bind it to a socker instead of a TCP port to avoid TCP overhead and accidentally allowing outer access to php5-fpm.

What’s the reason fpm needs to listen on a unix socket not a tcp port?

I already did that <br>and again the apache error <br>It’s strange because I have 2 similar server and one of them is working fine in new settings <br>:) somehow I’m losing my mind

Make sure php5-fpm is listening on a socket: <br> <br><pre>nano /etc/php5/fpm/pool.d/www.conf</pre> <br> <br>Look for the <code>listen=</code> directive and make sure it’s set to <code>/var/run/php5-fpm.sock</code> <br> <br>Restart php5-fpm:<pre>sudo service php5-fpm restart</pre>

yes. I get apache error <br>error log shows this <br> <br>[error] [client 2.190.209.200] (2)No such file or directory: FastCGI: failed to connect to server “/usr/lib/cgi-bin/php5-fcgi”: connect() failed <br>[error] [client 2.190.209.200] FastCGI: incomplete headers (0 bytes) received from server “/usr/lib/cgi-bin/php5-fcgi” <br>[error] [client 2.190.209.200] File does not exist: /var/www/favicon.ico

Did you install php5-fpm? <br> <br><pre>sudo apt-get install php5-fpm <br>sudo service apache2 restart</pre>

that’s what I did <br> <br> sudo apt-get install apache2-mpm-worker <br>sudo a2enmod actions fastcgi alias <br>sudo service apache2 restart <br> <br>and I add this to site defaults <br> <br><IfModule mod_fastcgi.c> <br> AddHandler php5-fcgi .php <br> Action php5-fcgi /php5-fcgi <br> Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi <br> FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization <br> </IfModule>

I switched to worker and when I want to visit website it download a php file (as I think index). also before swiching I deactivate mod_security and evasive. the only not default module is headers that I dont think it is a problem, <br>when I wantet to install worker ubuntu removed 2 packages. one of them was prefork and another one was libapache2-mod-php5 and I think maybe it’s the problem.

Event is available only if you’re running Apache2.4 which is unlikely. I don’t know about mod_evasive but try switching to mpm_worker. If it’s not compatible with it, simply revert back to mpm_prefork.