I'm beginning to think PHP contributes to extra milliseconds of waiting time. After all, my website is mostly meant for showing photos and I like to have things work fast and so does google.
I was experimenting with fastCGI extension for apache. I successfully created a program to use with it and the program produces expected output when I load it via a web browser. I also installed signal handlers (sigterm, sigkill, sigabrt) in my program which cause it to exit when they are detected.
Here's the problem
Every time I update code to my program, I cannot seem to terminate just the running program without terminating apache followed by terminating the process ID of the program. This is a problem because if I start making programs on a live server, restarting apache every time will cause inconveniences to website guests as well as to myself.
I read fastCGI is supposed to run the program code once and keep it in memory so that the overhead of starting the program doesn't happen every time. Already, this sounds better than going through the overhead of starting php and interpreting php code which is what is happening now when people access my pages.
Is fastCGI the wrong extension for me at this time? or do I need to configure it in a special way so that I can just kill (force-terminate) only the program being tested and leave apache running? If there's a better known and well-trusted extension, I may go for that instead.
Any ideas are welcome including ideas of what to include in my apache configuration.
So far, this is what is in my apache configuration file as it relates to fastCGI:
FastCgiConfig -autoUpdate
<location />
Options +ExecCGI
SetHandler fastcgi-script
</location>
This allows me to treat everything in the root folder as if it was a script that can be executed which at the moment is ok since I'm using a local-only test server.
Any ideas are welcome.