When you say "persistent connections", I think DBI. I know both from experimentation and documentation that establishing a connection to a database is expensive. DBI isn't involved in this project though (despite the database metaphor), so I guess what I need to know is how to do what DBI is doing.
Forgive my ignorance, but just what does "persistent connection" mean in this context? How do I get one?
You might want to have a look at POE.
Thanks for the tip. It looks daunting.
I guess I need to bone up on the fundamentals of sockets programming first. Judging from the responses so far, they're the answer. Since I've never had to solve this problem before, I wasn't sure if that was the right place to look, or if there was something else I should be checking out too. | [reply] |
"Persistent connection" in this context means, that the communicating sockets on
each side are set up and showing up as "ESTABLISHED" in the network connections table, which means, the server has done an accept(), just sits there and is ready to read from the socket whatever the client may tell it.
Persistent means also that there's no shutdown of the connection after some talk or after some idle time, so whenever a request comes in to the dispatching server, it can query the database nodes without having to set up the connection anew with all overhead of socket allocating, listen, bind, accept calls, SYN,SYN-ACK,ACK handshake and so on. Pretty much like a "leased line" vs. "dialup connection".
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] |