lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Sun, 2010-10-03 at 22:28 -0300, Diego Nehab wrote:
> Hi,
> I have not tried to implement support for persistent connections in
> LuaSocket because of the complications involved. I don't know how you
> modified the API to support multiple requests per connection, so I
> can't tell where it is going wrong. But if you use http.request(), it
> will close the connection as soon as it done getting the response
> body.
I use luasoap with luasocket to send soap calls to VMware servers.  This
overall works beautifully and functionality wise I'm a happy camper
(having a wsdl->lua converter would be nice though, but that's a
different topic).

However, for even simple tasks I end up doing dozens of SOAP calls,
ending up sometimes doing about 1000 calls within 5 minutes.  And all
that over HTTPS (I added a little piece of code to the open method to
call ssl.wrap on the socket). Right now even a simple call takes about
0.2 seconds, so I'm reaching the end of the line and I'm looking for
speedups.  Trying to re-use the connection instead of re-creating it for
every call was/is one of my ideas.

Just to see if that would work, I tried to simply comment out all
"close" calls I could find (in socke.lua and http.lua) to see if the
server side would accepts the 2nd call over the same connection.  But
somehow I'm missing one place, because the socket is still closed after 
the first request and I can't figure out where/how that happens.