| Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95460 is a reply to message #95459] |
Sat, 25 February 2012 00:25   |
|
shazar wrote on Sat, 25 February 2012 11:56Not an issue. a Xen domU (guest) sees its dedicated memory the same as s dedicated installation of Linux. When you do file intensive operations writes are buffered in memory so when you read the file you read from the memory instead of having to do disk operations. When you do a copy of a file, it is much slower on a system with low memory as on a system with more memory the copy is complete after it is buffered into memory. In the background it is still writing to disk, If you try to read the new file you still read it fine as it is reading from that buffered/cached memory. It works out great. There is no problem at all with the buffering and caching.
I have buffers/cached issue on your vpses when I used (and then I can not access now without information from you). Also on my dedis.
|
|
|
|
|
|
|
| Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95541 is a reply to message #95160] |
Mon, 27 February 2012 17:30   |
 |
wira4ce Messages: 3 Registered: February 2012 |
Member |
|
|
Thanks for the guide,
I did used the setting as recommended on my vps openvz, everything run fast and great. Besides the ram usage, it keep increasing from times. I did check with free -m, but buffer+/- indicate the same as above which my memory almost reach it maximum.
This really make me worried. Do I did it wrong? I followed everything posted. And is there any other way to reduce overall ram consumption from keep increasing?
total used free shared buffers cached
Mem: 1024 917 106 0 0 0
-/+ buffers/cache: 917 106
[Updated on: Mon, 27 February 2012 17:31] Report message to a moderator
|
|
|
|
|
|
| Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95549 is a reply to message #95548] |
Tue, 28 February 2012 00:37   |
 |
wira4ce Messages: 3 Registered: February 2012 |
Member |
|
|
I did done that before but the issue still remaining. here is my configuration. I used Nginx-proxy
/etc/httpd/conf/httpd.conf
<IfModule prefork.c>
StartServers 1
MinSpareServers 1
MaxSpareServers 5
ServerLimit 50
MaxClients 50
MaxRequestsPerChild 5000
</IfModule>
/etc/httpd/conf.d/~lxcenter.conf
<IfModule prefork.c>
StartServers 2
MinSpareServers 5
MaxSpareServers 10
ServerLimit 10
MaxClients 10
MaxRequestsPerChild 2000
MaxMemFree 5
SendBufferSize 65536
ReceiveBufferSize 65536
</IfModule>
did everything all right? when the memory full, my webpage displayed 500 error frequently.
[Updated on: Tue, 28 February 2012 00:54] Report message to a moderator
|
|
|
| Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95556 is a reply to message #95160] |
Tue, 28 February 2012 06:07   |
|
mustafaramadhan wrote on Sat, 18 February 2012 01:37
3. add php-fpm on apache but still with 1 pool only (fastcgi finalty for setting with more than 1 pool) -- waiting for Apache 2.4.x and than change mod_fastcgi to mod_proxy_fcgi
I would use the official FastCGI module for Apache 2 (mod_fcgid) instead
mod_fastcgi has plenty of stability issues, while the current release of mod_fcgid is stable.
|
|
|
|
|
|
| Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95563 is a reply to message #95556] |
Tue, 28 February 2012 08:26   |
|
philipp wrote on Tue, 28 February 2012 18:07mustafaramadhan wrote on Sat, 18 February 2012 01:37
3. add php-fpm on apache but still with 1 pool only (fastcgi finalty for setting with more than 1 pool) -- waiting for Apache 2.4.x and than change mod_fastcgi to mod_proxy_fcgi
I would use the official FastCGI module for Apache 2 (mod_fcgid) instead
mod_fastcgi has plenty of stability issues, while the current release of mod_fcgid is stable.
In my opinion, it's better use php-fpm with mod_proxy_fcgi (coming with Apache 2.4.x) instead mod_fastcgi or mod_fcgid.
It's a technical reasons.
|
|
|
| Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95564 is a reply to message #95561] |
Tue, 28 February 2012 08:32   |
|
lupetalo wrote on Tue, 28 February 2012 19:31I must say, on low spec vps i cant see any diff between apache and nginx proxy in any given configuration....
The reason for using nginx-proxy instead apache or nginx alone:
1. Static files handle by nginx and php by apache for high-traffic bandwith
2. Reduce memory usage compare to apache alone
3. Compatilibilty for .htaccess compare to nginx alone
All 3 reasons above importance for share-hosting where customer more familiar with .htaccess setting.
For non-share-hosting, consider to use nginx alone.
|
|
|
| Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95567 is a reply to message #95563] |
Tue, 28 February 2012 09:06   |
|
mustafaramadhan wrote on Tue, 28 February 2012 08:26In my opinion, it's better use php-fpm with mod_proxy_fcgi (coming with Apache 2.4.x) instead mod_fastcgi or mod_fcgid.
No, not as replacement for php-fpm with mod_proxy_fcgi but instead of using mod_fastcgi (which is what your configuration is using now)
|
|
|
| Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95571 is a reply to message #95549] |
Tue, 28 February 2012 09:26   |
|
wira4ce wrote on Tue, 28 February 2012 00:37
/etc/httpd/conf.d/~lxcenter.conf
<IfModule prefork.c>
StartServers 2
MinSpareServers 5
MaxSpareServers 10
ServerLimit 10
MaxClients 10
MaxRequestsPerChild 2000
MaxMemFree 5
SendBufferSize 65536
ReceiveBufferSize 65536
</IfModule>
did everything all right? when the memory full, my webpage displayed 500 error frequently.
Remove the MaxMemFree line and set the MaxClients lower. Run a test against your site that will use a number of concurrent connections that is at least the number of MaxClients. Then view the memory usage. This will give you a pretty accurate idea of the maximum memory usage that your Apache configuration will use.
MinSpareServers and MaxSpareServers do nothing for the maximum memory usage. It only removes previously used Apache processes that will be added again under heavy load. To get a better idea of your maximum memory usage you can also set the first 5 lines to the same number.
Also do a ps aux | grep httpd and count the number in use to make sure it is actually taking the ~lxcenter.conf settings over the httpd.conf. I have used Apache where these values weren't overridden. To be safe, I actually remove the reference completely from httpd.conf. This way I know without a doubt what settings are being used.
https://www.mercuryvps.com
HyperVM Xen VPS hosting
[Updated on: Tue, 28 February 2012 09:27] Report message to a moderator
|
|
|
|
|
|
| Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95631 is a reply to message #95627] |
Wed, 29 February 2012 16:50   |
|
wira4ce wrote on Thu, 01 March 2012 03:07Hi salam,
Just to share some information after a few days looking for the problem which refer to my previous problem. Hope this will helping other who had same issue as mine. I did everything including adjusting httpd.conf and all, but seem the problem was not solve. Then I found the real problem was originally from xcache. Disabling xcache in php did solve the memory issue. Now even I got high traffic. Ram still below 400 mb. I did change some configuration to fully optimize web suited with the normal traffic.
hope this information could help other. I just had 1 other problem unsolved, I did click on my awstats on kloxo domain, then my browser downloading awstats.pl, it not showing the stat. what is the problem? is that because of enabling nginx? thanks
I hope memory issue on apache is xcache like your information. We don't xcache for nginx and nginx-proxy.
About .pl issue, not implementing yet. Still focus for others.
[Updated on: Wed, 29 February 2012 16:58] Report message to a moderator
|
|
|
|