Monday 24 April 2006 3:52:22 pm - 29 replies
It would be great to make code memcache compatible to speed up heavy load sites
More info about memcache
http://www.danga.com/memcached/
http://en.wikipedia.org/wiki/Memcached
Monday 24 April 2006 4:22:13 pm
It's a nice approach, but I'm not sure how much you'd really gain by it in ezp's case:
If you turn on debug mode, you'll see that, usually, most of the load is not SQL queries but rather template processing which is better optimized with sensible caching inside that (ez does it, but you can optimize a lot by hand). It is also relatively easy to spread ez to different boxes (compared to a DB, anyway).
Plus for big, relatively static sites there's always the static page cache which can't be otherwise beaten, at all (except by replacing Apache with something faster).
Modified on Monday 24 April 2006 4:22:29 pm by Gabriel Ambuehl
Sunday 30 April 2006 3:16:18 pm
Gabriel: Do you mean something specific with 'except by replacing Apache with something faster)'?
Could http://www.lighttpd.net/ be one of those?
Have anyone tested lighthttpd with eZ??
The reason I ask is that lighthttpd is supposed to be lighter and faster then apache.
Thursday 04 May 2006 10:49:07 pm
A friend of mine did benchmarks with lighttpd and php fastcgi vs Apache with mod_php for some generic scripts. Lighttpd was slightly to a LOT faster but I don't think ez currently works in php fastcgi mode.
But for busy sites, it would definitely be worth considering to put static content such as images on lighttpd. I know the admin of one those party pictures sites and he says for static serving of pictures etc, it's much much faster.
Modified on Thursday 04 May 2006 10:51:35 pm by Gabriel Ambuehl
Friday 05 May 2006 4:05:25 am
I use nginx webserver + php in fcgi mode to run EZ. Everything is fine. Mush better than apache + mod_php.
nginx ~ lighttpd (a bit more fast, but with lask of international support)
http://sysoev.ru/nginx
FCGI get you very big advantages when no static cache used. It protects you server from overload, when you ged 1000 requests wich have to generate viewcache.
The second advandage is the possibility to run several php versions with the same webserver. No need to have headaches with running several webservers on different ports or different IPs.
The third advantage is that you can easily control your CPU resources. For example, I have 3 FCGI processes for EZ (php4), and 5 FCGI processes (php5) for other scripts (forums, blogs and so on). That prevents EZ to take 100% CPU resources at high load.
To summarise the difference on nginx (or lighttpd) + FCGI php / apache + mod_php:
- when top shows server load less than 1, then almost no performance gain
- when top shows server load > 1, you can gain several times.
Try to imagine, that you run php with accelerator and without it. Here is the similar situation
.
Modified on Friday 05 May 2006 4:32:49 am by Vitaly Puzrin
Saturday 06 May 2006 9:20:59 pm
@Xavier Dutoit
I did no benchmarks. It's my opinion, based on running unix "top" utility. With apache + mod_php the average load was 4-5. With nginx + FCGI the average load was about 2-3.
Futhermore, with apache + mod_php server could go to infinit swapping after viewcache reset. For example, you can get 20 requests to the same page (without cache). That causes 20 (!) processes to build cache for the single page. With apache you can really go out of resources. I had such situation several times.
About compatibility - yes, everything works for me, I didn't find any differences at all.
@Gabriel Ambuehl
You are almost right. But don't forget, that I've changes webserver software too. For example nginx can hold 10 000 keepalive connections and require only 2.5 mb memory for it.
Changing only php mode will help a lot, but will not completely solve the problem. You'd better to change the webserver too. Apache makes additional process for every new keepalive connection. That require too many memory.
The rude model of server overload can be decribed with this steps:
1. You get too many requests, requiring to rebult cache
2. CPU goes down ![]()
3. Too many copies of apache
4. Lack of memory
5. Swapping (and even more load to CPU)
6. Lack of swapping space (sometime)
7. bye-bye ![]()
FCGI will help you with (2), but will not help with (3,4). To resolve (3,4) you must change apache to nginx, lighttpd, zeus and so on.
@ALL
Just a notice. If you use static cache, and CPU load is less than 1, then you don't need such uprgade. That helps only with peak loads. If you don't youse static cache, and CPU load can be >1, then software upgrade can give a great help.
In situiation, when viewcache is already build, nginx+FCGI will not get you advantage in speed, but anyway, it will save a lot of memory. You will be able to give more memory for mysql, for example, instead of wasting memory for apache+mod_php
Modified on Saturday 06 May 2006 9:48:23 pm by Vitaly Puzrin
Tuesday 09 May 2006 4:55:38 pm
@Vitaly
Hi, I tried (briefly) lighthttpd. I've been stopped by the mod_rewrite rules, as the syntax is quite different.
Out of curiosity (and lazyness) are you using lighthttpd with virtual urls and rewrite rules ? Would you mind sharing your knowledge with us ?
X+
Thursday 11 May 2006 6:38:08 am
lui,
Ok. I'll try to publish my nginx config files for EZ with static cache option on. But anyway, you'll have to read nginx docs yourself with translator (like babelfish and so on). Because I have no time for advanced consulting.
Here it the place to start with: http://sysoev.ru/en/
You will have also to subscribe to english mail list (nginx @ sysoev.ru). It's now empty, but nginx author will reply. Send some text to that address, there is majordomo script.
English maillist archive is here: http://dir.gmane.org/gmane.comp.web.nginx.english
If it's too difficult for you, then try to put you vision on lighttpd or zeus. All 3 webservers (nginx, lighttpd and zeus) have their own advantages and disadvantages.
I've selected nginx, because it has very effective support at my natural language, right from developper, and because nginx is very well optimised for memory and CPU usage (better, than lighttpd). It's espesially effective with static content. But note right now, that it doesn't support CGI at all - only FastCGI. Lighttpd has CGI support via wrapper module.
Xavier,
You can use unilimited number of php versions with single lighttpd or nginx. Selection can be done with site name or URL path. Please, read lighttpd docs. There are enougth details.
Thursday 11 May 2006 7:44:22 pm
to Vitaly Puzrin:
thanks for the info.
I decided to give lighttpd a try. I installed it and ez can work on it now
however, as ez does not support cgi/fastcgi properly, something is broken. (such as search)
May I know how do you overcome these issues with lighttpd/fastcgi?
Friday 12 May 2006 12:19:43 pm
hm... to be honest, I don't use embedded search at all. I do use mnogosearch engine with php frontend. It's more suitable for my needs. EZ version is 3.7.5.
May be, I don't use all EZ features, but I didn't noticed any problems with FCGI.
Probably, the point is not in EZ, but in lighttpd config. I've spent 1 week to make nginx work right with my requirements. May be, you just need a more time
. You could miss setup for some FCGI variables, for example.
It would be interesting to get your opinion about server load with lighttpd + FCGI. My guess - at least 2 times, if it was above 1 before upgrade.
The other solution is to setup lighttpd as frontend, for static content and keepalive support. And apache will be at backend, only for php processing, and with keepalive off. That will help too, but not as good as "clear" lighttpd without apache at all.
Modified on Friday 12 May 2006 12:26:50 pm by Vitaly Puzrin
You must be logged in to post messages in this topic!