FastCGI: Persistent Applications for Your Web Server
My example script doesn't tackle many of the tasks at which FastCGI excels: persistent database connections, format translation (e.g., SGML to HTML) or providing common HTML page headers and footers. At the site I manage, I use FastCGI to do all these things and more.
I've found that a FastCGI application can perform its duties, including multiple SQL queries, and deliver a page on the fly only slightly slower than the server can deliver static documents. On a 10Mbps LAN connection the speed difference is perceptible, but just barely, and only if I'm looking for it. Over a 128Kbps or slower connection, I notice no difference.
I still use CGI to perform simple, infrequently needed tasks. A CGI script doesn't hog system resources for very long. For complex, frequently invoked tasks, FastCGI provides a great combination of flexibility and speed.
The two listings referred to in this article are available by anonymous download in the file ftp.linuxjournal.com/pub/lj/listings/issue55/2607.tgz.
Paul Heinlein (email@example.com) lives with his family near Portland, Oregon and is Webmaster at http://www.computerbits.com/. When he and his daughter aren't playing CD-ROM-based games, Paul indulges his odd hankering for Lutheran theology and hymnody.
- Readers' Choice Awards 2013
- Two Pi R
- Non-Linux FOSS: Let's Make Music Together
- Best. Cake. Ever.
- The Geek's Guide to the Coolest 2013 Holiday Gifts
- A Handy U-Boot Trick
- AIDE—Developing for Android on Android
- Raspberry Pi: the Perfect Home Server
- Tech Tip: Really Simple HTTP Server with Python
- Linux Systems Administrator
12 hours 22 min ago
- Thanks for clearing that up.
17 hours 45 min ago
- Nice coding on the cake. I
1 day 5 hours ago
- Baker's identity
1 day 10 hours ago
- Uber jealous
1 day 15 hours ago
- Reality is disapointing
2 days 1 hour ago
- Máy sấy quần áo
2 days 4 hours ago
- Services on GlusterFS
2 days 4 hours ago
- Reply to comment | Linux Journal
2 days 6 hours ago
- Definitely cool stuff here
2 days 7 hours ago