1

I'm running Symfony's built-in server during development and noticed that CPU usage of CLI.exe (PHP's command-line interface that's called through php bin/console server:run) is always around 30%, even when idle.

I launch it from a Windows Powershell. Any idea why this happens during idle time?

1
  • 3
    What are you expecting pluppfisk. This is not the way to run Symfony, and @Chris is correct. Commented Jul 26, 2016 at 16:00

1 Answer 1

5

PHP's built-in web server is only meant to be used during development:

Warning This web server was designed to aid application development. It may also be useful for testing purposes or for application demonstrations that are run in controlled environments. It is not intended to be a full-featured web server. It should not be used on a public network.

It makes no performance guarantees, and I'm not surprised that it has high CPU utilization.

The Symfony documentation suggests that it is only meant as a convenience:

This way, you don't have to bother configuring a full-featured web server such as Apache or Nginx.

Of course, you are free to run a full-featured web server in development if you want something more tuned to real world use.

Sign up to request clarification or add additional context in comments.

9 Comments

Fair enough point, but why does it use CPU when idle. It really shouldn't be doing anything at all. Using the Apache web server doesn't give you the console and requires more frequent cache clearing, so it's not a proper option at the moment.
@bluppfisk, it appears to run an event loop. I don't know enough about web servers to know if that's a good approach or not, but it clearly is doing something while it's listening for connections.
Thanks for pointing that out. Interesting. But also annoying as it makes mobile development difficult - battery drained in 3 hours.
can I ask what all of you do when developing in Symfony? Just switch straight to production mode and use the web server? Or is there a way to use the Apache server properly without changing to production mode? I regularly run into all kinds of route caching trouble when using Apache in dev mode.
"only meant to be used during development" - does development not need performance? :/
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.