Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting worse performance with save_comments = 0 and enable_file_override = 1 #64

Closed
ricardclau opened this issue Mar 15, 2013 · 7 comments

Comments

@ricardclau
Copy link

Hi

Some days ago I did some performance tests with a Hello world built up with Symfony2 framework. You can see some metrics here http://www.ricardclau.com/2013/03/apc-vs-zend-optimizer-benchmarks-with-symfony2/

While most of the results were consistent and of course faster than APC those two settings led to worse performance than letting them default values.

I've repeated the test several times on my machine (to discard eventual CPU exhausting processes) and it always gives less performance (about 10%).

I'm using MacOsX, PHP 5.4.12 and I git cloned about 10 days ago.

Might it be an issue with MacOsX? Maybe with Symfony2?

Comments or hints appreciated!

@dstogov
Copy link
Contributor

dstogov commented Mar 15, 2013

hi Ricard,

Thank you for the post and good bechmarks :)

I've never worked with Symphony myself, but already got few reports, that it doesn't work properly with save_comments=0. This option disables saving/loading doc_coments that used in Symphony for some purpose.

enable_file_override=1 may make speedup or slowdown dependent on application. It speedups file_exists(), is_file() and is_readable() for files cached by O+, but makes them a bit slower for the others.

Thanks. Dmitry.

@ricardclau
Copy link
Author

Hi Dimitry

Well, Symfony2 uses annotations /comments as one of the ways you can configure your application. There is a CLI command that converts these annotations / comments into plain PHP and of course with save_comments = 0, this just does not work as it is perfectly explained in your documentation. However, once the cache is warmed up, Symfony2 works perfectly :)

Regarding enable_file_override... well it might slow down the first request, but not the subsequents right? Symfony2 uses a lot of files and it may slow down autoload the first time, but not the following ones if I understand properly what you mean. Weird indeed! Any other guesses about what might be slowing down the HTTP responses?

@dstogov
Copy link
Contributor

dstogov commented Mar 15, 2013

Well, Symfony2 uses annotations /comments as one of the ways you can

configure your application. There is a CLI command that converts these
annotations / comments into plain PHP and of course with save_comments = 0,
this just does not work as it is perfectly explained in your documentation.
However, once the cache is warmed up, Symfony2 works perfectly :)

I didn't get how you may change save_comments to 0 after warming the cache.
You probably work with save_comments=1

Regarding enable_file_override... well it might slow down the first
request, but not the subsequents right? Symfony2 uses a lot of files and it
may slow down autoload the first time, but not the following ones if I
understand properly what you mean. Weird indeed! Any other guesses about
what might be slowing down the HTTP responses?

No. It may speedup or slowdown not only the first request, but every
request, because those functions are executed at run-time.

@ricardclau
Copy link
Author

Sorry I may have not explained myself properly about how Symfony deals with annotations and how I did the test. What I did was to set save_comments to 1, warm the cache (annotations are read) set save_comments back to 0, reload apache config and execute ab (once the cache is warm, Symfony does not read annotations any more). So for HTTP requests save_comments was set to 0

But what might explain performance decrease is what you say about enable_file_override, specially if it happens at run time as you mention

Thanks for clarifying all this stuff

El 15/03/2013, a les 21:56, Dmitry Stogov notifications@github.com va escriure:

Well, Symfony2 uses annotations /comments as one of the ways you can

configure your application. There is a CLI command that converts these
annotations / comments into plain PHP and of course with save_comments = 0,
this just does not work as it is perfectly explained in your documentation.
However, once the cache is warmed up, Symfony2 works perfectly :)

I didn't get how you may change save_comments to 0 after warming the cache.
You probably work with save_comments=1

Regarding enable_file_override... well it might slow down the first
request, but not the subsequents right? Symfony2 uses a lot of files and it
may slow down autoload the first time, but not the following ones if I
understand properly what you mean. Weird indeed! Any other guesses about
what might be slowing down the HTTP responses?

No. It may speedup or slowdown not only the first request, but every
request, because those functions are executed at run-time.

Reply to this email directly or view it on GitHub.

@dstogov
Copy link
Contributor

dstogov commented Mar 16, 2013

In case files were already saved with doc comments, the save_comments value
doesn't matter.
It's possible to disable comments loading (load_comments=0), but it would
break Symphony.
Anyway, save/load_comments are not suitable optimization a for Symphony.

Dmitry.

On Saturday, March 16, 2013, Ricard Clau wrote:

Sorry I may have not explained myself properly about how Symfony deals
with annotations and how I did the test. What I did was to set
save_comments to 1, warm the cache (annotations are read) set save_comments
back to 0, reload apache config and execute ab (once the cache is warm,
Symfony does not read annotations any more). So for HTTP requests
save_comments was set to 0

But what might explain performance decrease is what you say about
enable_file_override, specially if it happens at run time as you mention

Thanks for clarifying all this stuff

El 15/03/2013, a les 21:56, Dmitry Stogov <notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>>
va escriure:

Well, Symfony2 uses annotations /comments as one of the ways you can

configure your application. There is a CLI command that converts these
annotations / comments into plain PHP and of course with save_comments
= 0,
this just does not work as it is perfectly explained in your
documentation.
However, once the cache is warmed up, Symfony2 works perfectly :)

I didn't get how you may change save_comments to 0 after warming the
cache.
You probably work with save_comments=1

Regarding enable_file_override... well it might slow down the first
request, but not the subsequents right? Symfony2 uses a lot of files
and it
may slow down autoload the first time, but not the following ones if I
understand properly what you mean. Weird indeed! Any other guesses
about
what might be slowing down the HTTP responses?

No. It may speedup or slowdown not only the first request, but every
request, because those functions are executed at run-time.

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com/zend-dev/ZendOptimizerPlus/issues/64#issuecomment-14995950
.

@ricardclau
Copy link
Author

Restarting Apache does not reset Zend Optimizer+? If not, how can this cache be restarted?

@dstogov
Copy link
Contributor

dstogov commented Mar 17, 2013

Of course, it resets O+.

@dstogov dstogov closed this as completed Mar 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants