I'll like to know what are the things to consider when choosing between configuring an app as static or as dynamic in an Apache 2 server that uses mod_fastcgi. The app is a typical reporting app written in Perl with MySQL as the Db backend with fairly medium traffic. I'll love to hear your experiences about running FastCGI in such a scenario.
Neither of them really has set performance or scalability characteristics divorced from the context of your app and its environment. Which would work better depends on what you have going on.
Static: set number of app processes that hang around all the time. Conditions that argue for this include:
- You can afford to have enough instances of the app hanging around all the time to speedily serve as much traffic as you ever get, for whatever reason (the machine doesn't need to do anything much else, you never really get that much traffic, the machine has lots of spare resources, what-have-you).
- An app process instance has significant startup time and your users will be annoyed by it.
- The machine needs to only ever have some set proportion of its resources used up by this app so that other jobs can run without undue interference.
Dynamic: variable number of app processes that are started on demand and killed off when unused. Conditions that argue for this include:
- Your traffic is very spiky (self-similar), so that it's important to be able to spawn more app processes to handle it.
- An app process instance starts up very quickly, so it doesn't do much harm if one needs to be spawned to handle a request.
- The machine does need its resources for other purposes, so it's nice to free them up when you can, but it's okay to soak up a lot of them for this app when its traffic is heavy.