[uWSGI] call a "streaming" LUA RPC from python

Davide Setti davide.setti at gmail.com
Tue Mar 29 17:19:31 CEST 2016


Hi,
I have a python web service that does an HTTP request to ElasticSearch and
generates a JSON with all the results. The problem is that the result set
can be quite big, therefore we switched to ijson for streaming JSON
decoding and chunked encoding for the output.

But now it's slow, because ijson is: the whole thing is now CPU bound.

One possible solution would be to write the JSON parsing in C, but I can't
write proper C code anymore... :(

Another solution would be to call a LUA RPC, but we would have memory
problems because uWSGI RPC only supports strings as an exchange format, a
single string I think. Are there tricks to easily dump to file/unix pipes
or something?

Regards.
-- 

Davide Setti
code: http://github.com/vad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.unbit.it/pipermail/uwsgi/attachments/20160329/52d4452b/attachment.html>


More information about the uWSGI mailing list