views:

124

answers:

2

I'm sending post requests to a Pylons server (served by paster serve), and if I send them with any frequency many don't arrive at the server. One at a time is ok, but if I fire off a few (or more) within seconds, only a small number get dealt with. If I send with no post data, or with get, it works fine, but putting just one character of data in the post fields causes massive losses.

For example, sending 200, 2 will come back. Sending 100 more slowly, 10 will come back.

I'm making the requests form inside a Qt application. Tis will work ok (no data):

QString postFields = "" QNetworkRequest request(QUrl("http://server.com/endpoint")); QNetworkReply *reply = networkAccessManager->post(request, postFields.toAscii());

And this will result in only a fraction of the requests being dealt with:

QString postFields = "" QNetworkRequest request(QUrl("http://server.com/endpoint")); QNetworkReply *reply = networkAccessManager->post(request, postFields.toAscii());

I've played around with turning on use_threadpool, and other options (threadpool_workers, threadpool_max_requests = 300), of which some combinations can alter the results slightly (best case 10 responses in 200).

If I send similar requests to other (non paster) servers, the replies come back ok, so I'm almost certain its'a paster serve config issue.

Any help or advice greatly appreciated.

Thanks

Philip

A: 

Could you add logging on paster/pylons side to find where exactly these requests get lost? Are you sure that QT app is working right, may it be limit on the number of concurrent connections in QNetworkRequest? AFAIR QT networking uses separate thread for connection allocated from thread pool. Try adding error handling on QT side.

Yaroslav
Thanks. Seems Qt was behaving ok, it was the server becuase of it's lack of HTTP 1.1 support.
Philip McDermott
+1  A: 

Thanks for you reply.

Tracked it doen to the fact that paster serve only supports HTTP 1.0, and so wasn't responding to initial requests with a 100 code.

Switched to Apache, all working now!

Philip McDermott