|
Posted by Felix E. Klee on 11/09/02 11:18
At 10 Jun 2005 00:58:04 GMT,
Daniel Tryba wrote:
> Is there an actual problem with opening 1 tcp socket to the nntp
> server per http request?
Yes, it takes several seconds since:
1. For authenticating a user, the news server needs to contact a
PostgreSQL database twice (once for verifying UID and password, and
once for deciding which groups the user has access to).
2. The server hosting the PostgreSQL database is quite slow.
Some alternatives to opening a persistent connection to the news server:
* Cache the login and groups data in a simple database that doesn't take
as long to connect to as PostgreSQL.
* Open a persistent connection to the PostgreSQL database for the perl
scripts doing the authentication.
Both of the above solutions appear about as complex as opening a
persistent connection to the news server. So I'm not too fond of them,
especially as they will be a bit slower.
> If there is you can:
> -write a daemon like you suggested, can be written in any language you
> feel comfortale with (that includes php).
I'm unlikely the first person with such a problem, so I was hoping for a
pointer to a ready made solution.
> -switch (partially) to an other enviroment which actually has support
> for threading (eg Java/Servlets)
How could that help? However, concerning threading, it may be
interesting to try out how "pfsockopen" would behave with a
multithreaded Apache (see e.g. module MPM worker).
--
Felix E. Klee
Navigation:
[Reply to this message]
|