I had an issue with the Lua plugin where the first request would work
great, but the second would result in 'bad gateway' errors from nginx.

At first thought this was an Orbit problem, but it turns out a line of
code commented as 'performance hack' was actually messing up data
inside the Lua state. 

Patch is attached. It's very simple, and maybe not the best fix. But,
it makes uWSGI + Lua Orbit stable without a noticable performance hit:
5000+ hits from httperf with only "200 OK" responses.

-- 
Aaron B. <[email protected]>
diff -u -r uwsgi-1.3/plugins/lua/lua_plugin.c uwsgi-1.3-patched//plugins/lua/lua_plugin.c
--- uwsgi-1.3/plugins/lua/lua_plugin.c	2012-09-30 03:24:02.000000000 -0400
+++ uwsgi-1.3-patched//plugins/lua/lua_plugin.c	2012-10-06 15:32:50.000000000 -0400
@@ -488,7 +488,7 @@
 		wsgi_req->headers_size += rlen;
 		// a performance hack
 		ptrbuf = (char *) http;
-		ptrbuf[3] = 0;
+		//ptrbuf[3] = 0;
 		wsgi_req->status = atoi(ptrbuf);
 		if ( (rlen = wsgi_req->socket->proto_write_header(wsgi_req, "\r\n", 2)) != 2) {
 			lua_pushvalue(L, -1);
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to