views:

82

answers:

2

I'm trying to improve the speed of our server but I would like to have your view of that before modifying everything.

I have a high read rate on my file system. Right now we are using regular PHP file. I wonder if I can cache these file in Memcache and later do an eval on the code if it will be faster than letting these file get interpreted.

So is it better to have memcache + eval or regular php interpretation. I think one solution can be tempfs but I haven't use it yet.

+3  A: 

I believe APC is the solution you are looking for as it does bytecode caching for you.

Jordan S. Jones
A: 

It depends... just create a model similar to your real environment and measure it. Using evals you may decrease fs-reading but increase swapping instead so you'll get no advantage.

To decrease FSreading try to merge tons of includes into 1 lib-file. You may write a script to merge these groups for production only on repository export (because it's hard to support the huge file). I.e my.lib.inc contains all includes when you develop software, and on export it's being replaced with merged content from all files instead of including them.

You can use smth. like APC, nginx etc to cache scripts and static content. Together these improvements should help.

Jet