Memcache

Author Message

luis muñoz

Monday 24 April 2006 6:52:22 am

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

Gabriel Ambuehl

Monday 24 April 2006 7:22:13 am

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).

Visit http://triligon.org

André R.

Sunday 30 April 2006 6:16:18 am

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.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

liu spider

Monday 01 May 2006 9:48:21 am

I do not think lighthttpd supports fancy features eZ requires to work properly with it

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

Björn [email protected]

Tuesday 02 May 2006 6:24:47 am

i have heard of ppl using lighthttpd over apache

since you can run e.g. 2 php versions with it.

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Gabriel Ambuehl

Thursday 04 May 2006 1: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.

Visit http://triligon.org

Vitaly Puzrin

Thursday 04 May 2006 7:05:25 pm

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 :) .

Xavier Dutoit

Friday 05 May 2006 5:28:14 am

@Vitaly

That sounds really great !

You have all the features from ez (including images resizing, char encoding and the al) ?

Did you run proper benchmark or is that just an impression that it runs faster ?

X+

http://www.sydesy.com

Gabriel Ambuehl

Friday 05 May 2006 5:43:02 am

So you're saying going from mod_php + accelerator to FCGI is like going from mod_php to mod_php + accelerator, right?

Visit http://triligon.org

Vitaly Puzrin

Saturday 06 May 2006 12: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

André R.

Monday 08 May 2006 1:40:24 pm

But have anyone tested eZ against Apache 2.2 or lighttpd?
Vitaly Puzrin: I need international support, so don't think nginx is for me.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Vitaly Puzrin

Monday 08 May 2006 9:25:45 pm

Do use lighttpd then. You'll get the similar results, as desribed above.

Xavier Dutoit

Tuesday 09 May 2006 7:55:38 am

@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+

http://www.sydesy.com

Vitaly Puzrin

Tuesday 09 May 2006 6:58:18 pm

Xavier,

I use nginx, not lighttpd, and those rewrite rules have different syntax. The only advice is to read documentation and support forum for lighttpd.

liu spider

Wednesday 10 May 2006 11:05:08 am

Vitaly Puzrin,
it would be really helpful if you can share your setup tips for eZ publish with nginx and FastCGI.

Seems quite promising to me

thanks

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

Xavier Dutoit

Wednesday 10 May 2006 11:17:57 am

@Vitaly

Have you tried to put together php4.3 and php4.4 on the same server ? If this is the case, it would be a good reason to try your solution, it'd be so much easier for the migration...

X+

http://www.sydesy.com

Vitaly Puzrin

Wednesday 10 May 2006 9:38:08 pm

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.

Xavier Dutoit

Thursday 11 May 2006 1:37:52 am

@Vitaly,

Thanks for your help and valuable advices.

X+

http://www.sydesy.com

liu spider

Thursday 11 May 2006 10:44:22 am

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?

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

Vitaly Puzrin

Friday 12 May 2006 3:19:43 am

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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.