Mobile app version of vmapp.org
Login or Join
Annie201

: How to kill program that displays webpages in fastcgi/apache I'm beginning to think PHP contributes to extra milliseconds of waiting time. After all, my website is mostly meant for showing photos

@Annie201

Posted in: #Apache #Configuration #WebApplications

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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Annie201

1 Comments

Sorted by latest first Latest Oldest Best

 

@Phylliss660

Use PHP-FPM if you want a faster alternative to mod_php, there's no need to try and roll your own solution.


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


This isn't really something that's specific to FastCGI, PHP from 5.5 onwards comes with a built in opcache that does basically this, so you'll have this behaviour regardless of what you use to serve it. (And for older versions there were third party opcache extensions such as APC.)

Also, in your question for speed you might want to consider nginx instead of Apache.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme