You are here: Persistent connections not limited to one Apache-process? « PHP Programming Language « IT news, forums, messages
Persistent connections not limited to one Apache-process?

Posted by Felix E. Klee on 09/30/15 11:18

I've set up a PHP web application where users can log in and open a
connection to a NNTP-server. There is a *one-to-one* relationship
between sessions and NNTP-connections (i.e. exactly one NNTP-connection
per session, and exactly one session per NNTP-connection).

Now, I'd like to have these connections be persistent. So I started
using "pfsockopen" instead of "fsockopen" and set Apache's
KeepAliveTimeout to a very high value. However, this doesn't work all
that great: Often browser-connections are closed prematurely and some
browsers have trouble with KeepAlive, anyway. After a
browser-connection has been closed, the next browser request will most
likely be answered by a different Apache process, and this process will
open a *different* persistent connection. In a nutshell:

* Persistency of the NNTP-connections over a lengthy period of time is
nearly impossible (unless the browser and the web server play well
together).

* More than one connection is created per session, which is a waste of
resources.

A solution that comes into my mind is using a separate daemon running on
the same machine as the web server. It would open persistent
NNTP-connections and connect them to a local socket. A PHP session
could then connect to that socket.

What do you recommend? Are there standard tools for that purpose? Any
ideas?

BTW, I'm running PHP4 on an Apache 2 LINUX-server, but upgrading
e.g. PHP should be no big problem.

--
Felix E. Klee

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация