LxCenter HyperVM & Kloxo Support

Forum



Members   Search      Help    Register    Login    Home
Home » Development Forums » Kloxo Development » [PRE] Nginx/Lighttpd proxy and template-based web config
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95460 is a reply to message #95459] Sat, 25 February 2012 00:25 Go to previous messageGo to next message
mustafaramadhan is currently offline mustafaramadhan  Indonesia
Messages: 5678
Registered: December 2010
Location: Yogyakarta
Super Grandmaster
Forum Moderator

shazar wrote on Sat, 25 February 2012 11:56
Not 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.


http://download.lxcenter.org/kdev.png
..:: MRatWork ::..
Server/Web-integrator - perfect not always more useful

--- Need KVM/OpenVZ VPS? - click here (Kloxo-MR READY!) ---

For bug/feature/security - Member rank status

http://download.lxcenter.org/hdev.png
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95466 is a reply to message #95460] Sat, 25 February 2012 09:19 Go to previous messageGo to next message
shazar is currently offline shazar  United States
Messages: 1856
Registered: May 2011
Grandmaster
LxCenter Core Team Member
LxCenter Representative
It is not an issue. This is how all operating systems work. Windows does write buffering and file caching as well. Come on now. Seriously? What else can I possibly say?

https://www.mercuryvps.com
HyperVM Xen VPS hosting
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95474 is a reply to message #95466] Sat, 25 February 2012 11:37 Go to previous messageGo to next message
Walter  
Messages: 865
Registered: February 2009
Location: Florianopolis / BR
Senior Master
Forum Moderator
LxCenter Project Manager

http://www.linuxatemyram.com/

Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95498 is a reply to message #95474] Sun, 26 February 2012 10:54 Go to previous messageGo to next message
Spacedust is currently offline Spacedust  Poland
Messages: 1233
Registered: October 2007
Location: Poland
Senior Master
Compare these results with Varnish and Apache 2.4.1.

[Updated on: Sun, 26 February 2012 10:56]

Report message to a moderator

Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95518 is a reply to message #95498] Sun, 26 February 2012 22:29 Go to previous messageGo to next message
mustafaramadhan is currently offline mustafaramadhan  Indonesia
Messages: 5678
Registered: December 2010
Location: Yogyakarta
Super Grandmaster
Forum Moderator

Spacedust wrote on Sun, 26 February 2012 22:54
Compare these results with Varnish and Apache 2.4.1.


Still focus for the last challenge (wildcards for lighttpd). No time for comparing and it's not necessary.

Try possilibility to implementing suphp for lighttpd, but not priority.


http://download.lxcenter.org/kdev.png
..:: MRatWork ::..
Server/Web-integrator - perfect not always more useful

--- Need KVM/OpenVZ VPS? - click here (Kloxo-MR READY!) ---

For bug/feature/security - Member rank status

http://download.lxcenter.org/hdev.png

[Updated on: Sun, 26 February 2012 23:06]

Report message to a moderator

Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95541 is a reply to message #95160] Mon, 27 February 2012 17:30 Go to previous messageGo to next message
wira4ce is currently offline 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 #95544 is a reply to message #95541] Mon, 27 February 2012 20:38 Go to previous messageGo to next message
mustafaramadhan is currently offline mustafaramadhan  Indonesia
Messages: 5678
Registered: December 2010
Location: Yogyakarta
Super Grandmaster
Forum Moderator

@wira4ce,

What's you choose?. Nginx, lighttpd, Nginx-proxy or Lighttpd-proxy?. If nginx/lighttpd-proxy, try click 'apache-optimize' on 'webserver config'. In nginx/lighttpd-proxy, value for max-spare only half value compare to apache alone.


http://download.lxcenter.org/kdev.png
..:: MRatWork ::..
Server/Web-integrator - perfect not always more useful

--- Need KVM/OpenVZ VPS? - click here (Kloxo-MR READY!) ---

For bug/feature/security - Member rank status

http://download.lxcenter.org/hdev.png
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95546 is a reply to message #95544] Mon, 27 February 2012 20:45 Go to previous messageGo to next message
shazar is currently offline shazar  United States
Messages: 1856
Registered: May 2011
Grandmaster
LxCenter Core Team Member
LxCenter Representative
mustafa - But what will the MaxClients be set to? max-spare is useless when talking about max memory usage.

https://www.mercuryvps.com
HyperVM Xen VPS hosting
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95548 is a reply to message #95546] Mon, 27 February 2012 22:14 Go to previous messageGo to next message
mustafaramadhan is currently offline mustafaramadhan  Indonesia
Messages: 5678
Registered: December 2010
Location: Yogyakarta
Super Grandmaster
Forum Moderator

shazar wrote on Tue, 28 February 2012 08:45
mustafa - But what will the MaxClients be set to? max-spare is useless when talking about max memory usage.

See the code and what you see?.

I think this is no hard for just download zip and see files inside.


http://download.lxcenter.org/kdev.png
..:: MRatWork ::..
Server/Web-integrator - perfect not always more useful

--- Need KVM/OpenVZ VPS? - click here (Kloxo-MR READY!) ---

For bug/feature/security - Member rank status

http://download.lxcenter.org/hdev.png
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95549 is a reply to message #95548] Tue, 28 February 2012 00:37 Go to previous messageGo to next message
wira4ce is currently offline 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 Go to previous messageGo to next message
philipp is currently offline philipp  Austria
Messages: 6
Registered: August 2011
Member
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 #95557 is a reply to message #95549] Tue, 28 February 2012 06:10 Go to previous messageGo to next message
mustafaramadhan is currently offline mustafaramadhan  Indonesia
Messages: 5678
Registered: December 2010
Location: Yogyakarta
Super Grandmaster
Forum Moderator

Your mod is good for 1024mb ram (run 'apache-optimize' in nginx-proxy mode will be set value like your mod).

http://download.lxcenter.org/kdev.png
..:: MRatWork ::..
Server/Web-integrator - perfect not always more useful

--- Need KVM/OpenVZ VPS? - click here (Kloxo-MR READY!) ---

For bug/feature/security - Member rank status

http://download.lxcenter.org/hdev.png
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95561 is a reply to message #95557] Tue, 28 February 2012 07:31 Go to previous messageGo to next message
lupetalo is currently offline lupetalo  Serbia
Messages: 252
Registered: April 2011
Senior Member
I must say, on low spec vps i cant see any diff between apache and nginx proxy in any given configuration....
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95562 is a reply to message #95561] Tue, 28 February 2012 07:34 Go to previous messageGo to next message
Spacedust is currently offline Spacedust  Poland
Messages: 1233
Registered: October 2007
Location: Poland
Senior Master
Can you add SWAP file to your VPS ?
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95563 is a reply to message #95556] Tue, 28 February 2012 08:26 Go to previous messageGo to next message
mustafaramadhan is currently offline mustafaramadhan  Indonesia
Messages: 5678
Registered: December 2010
Location: Yogyakarta
Super Grandmaster
Forum Moderator

philipp wrote on Tue, 28 February 2012 18: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.


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.


http://download.lxcenter.org/kdev.png
..:: MRatWork ::..
Server/Web-integrator - perfect not always more useful

--- Need KVM/OpenVZ VPS? - click here (Kloxo-MR READY!) ---

For bug/feature/security - Member rank status

http://download.lxcenter.org/hdev.png
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95564 is a reply to message #95561] Tue, 28 February 2012 08:32 Go to previous messageGo to next message
mustafaramadhan is currently offline mustafaramadhan  Indonesia
Messages: 5678
Registered: December 2010
Location: Yogyakarta
Super Grandmaster
Forum Moderator

lupetalo wrote on Tue, 28 February 2012 19:31
I 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.


http://download.lxcenter.org/kdev.png
..:: MRatWork ::..
Server/Web-integrator - perfect not always more useful

--- Need KVM/OpenVZ VPS? - click here (Kloxo-MR READY!) ---

For bug/feature/security - Member rank status

http://download.lxcenter.org/hdev.png
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95567 is a reply to message #95563] Tue, 28 February 2012 09:06 Go to previous messageGo to next message
philipp is currently offline philipp  Austria
Messages: 6
Registered: August 2011
Member
mustafaramadhan wrote on Tue, 28 February 2012 08:26
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.

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 Go to previous messageGo to next message
shazar is currently offline shazar  United States
Messages: 1856
Registered: May 2011
Grandmaster
LxCenter Core Team Member
LxCenter Representative
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 #95605 is a reply to message #95160] Wed, 29 February 2012 04:20 Go to previous messageGo to next message
amiri27 is currently offline amiri27  Canada
Messages: 12
Registered: February 2008
Location: Iran
Member
Hi..

I installed your modification on our server .. As you know one of main usage of Using Reverse proxy is caching.. but I think that is didn't work..

[root@server12 nginx]# cd cache/
[root@server12 cache]# ls -la
total 8
drwxr-xr-x 2 nginx root 4096 Feb 28 22:27 .
drwxr-xr-x 7 apache apache 4096 Feb 28 22:27 ..


I double checked the configuration but nothing invalid saw on that..

Could you please help me !?

Regards,
Mostafa Amiri
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95608 is a reply to message #95605] Wed, 29 February 2012 04:57 Go to previous messageGo to next message
mustafaramadhan is currently offline mustafaramadhan  Indonesia
Messages: 5678
Registered: December 2010
Location: Yogyakarta
Super Grandmaster
Forum Moderator

nginx cache inside /home/nginx/cache and /home/nginx/tmp. It's probable disable cache and use local access directly (see /home/nginx/globals/proxy.conf'

http://download.lxcenter.org/kdev.png
..:: MRatWork ::..
Server/Web-integrator - perfect not always more useful

--- Need KVM/OpenVZ VPS? - click here (Kloxo-MR READY!) ---

For bug/feature/security - Member rank status

http://download.lxcenter.org/hdev.png
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95627 is a reply to message #95608] Wed, 29 February 2012 15:07 Go to previous messageGo to next message
wira4ce is currently offline wira4ce
Messages: 3
Registered: February 2012
Member
Hi 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
Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95631 is a reply to message #95627] Wed, 29 February 2012 16:50 Go to previous messageGo to next message
mustafaramadhan is currently offline mustafaramadhan  Indonesia
Messages: 5678
Registered: December 2010
Location: Yogyakarta
Super Grandmaster
Forum Moderator

wira4ce wrote on Thu, 01 March 2012 03:07
Hi 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.


http://download.lxcenter.org/kdev.png
..:: MRatWork ::..
Server/Web-integrator - perfect not always more useful

--- Need KVM/OpenVZ VPS? - click here (Kloxo-MR READY!) ---

For bug/feature/security - Member rank status

http://download.lxcenter.org/hdev.png

[Updated on: Wed, 29 February 2012 16:58]

Report message to a moderator

Re: [PRE] Nginx/Lighttpd proxy and template-based web config [message #95666 is a reply to message #95631] Thu, 01 March 2012 12:15 Go to previous message
mustafaramadhan is currently offline mustafaramadhan  Indonesia
Messages: 5678
Registered: December 2010
Location: Yogyakarta
Super Grandmaster
Forum Moderator

Please posting to http://forum.lxcenter.org/index.php?t=msg&goto=95665

This thread closed.


http://download.lxcenter.org/kdev.png
..:: MRatWork ::..
Server/Web-integrator - perfect not always more useful

--- Need KVM/OpenVZ VPS? - click here (Kloxo-MR READY!) ---

For bug/feature/security - Member rank status

http://download.lxcenter.org/hdev.png
Previous Topic:register mail account in kloxo db
Next Topic:What is going on with Kloxo?
Goto Forum:
  


Current Time: Sat May 25 14:49:31 EDT 2013

Total time taken to generate the page: 0.01573 seconds
.:: Contact :: Home :: Privacy ::.

Click here to lend your support to: LxCenter and make a donation at www.pledgie.com !

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software