Commit Graph
79 Commits
Author SHA1 Message Date
Hleran f3bc21cf2b lua_plugin: no switch in 1st yield; async_id_get()
If coroutine and async, do not switch until first yield of coroutine;
uwsgi.async_id_get() to get 'wsgi_req->async_id' in my app;
2015-07-31 01:03:40 +03:00
Hleran a0dc7fdcf9 lua_plugin: wsapi func ref is constant, threading
correct multithreading support
2015-07-28 19:08:24 +03:00
Hleran 1e97a5e8d0 lua_plugin: malloc oversize 2015-07-28 13:04:11 +03:00
Hleran 4c152b237f lua_plugin: recheck async_status, clean threads
recheck async_status before pcall
keep our thread's stacks empty
2015-07-28 11:24:55 +03:00
Hleran 97304aded8 lua_plugin: better lazy check 2015-07-27 23:51:43 +03:00
Hleran fc088d4071 lua_plugin: .post_fork to .init_apps and lazy-apps
yes,  lazy-apps and lazy works fine
2015-07-27 19:51:46 +03:00
Hleran 916924c255 lua_plugin: change default gc mode etc...
- lua gc default is now LUA_GCSTEP instead of LUA_GCCOLLECT, the default value of gc-freq 0 with full collection after each request is really overkill. LUA_GCSTEP with default gc-freq works better. But you can always change gc to full collect via 'lua-gc-full = 1' opt;

- if our coroutine yields unexpected nil while in async mode, we retry the coroutine's call again in order to detect dead coroutine without async switch

- and some cleanup
2015-07-27 13:56:29 +03:00
Hleran cfaeb00a09 lua_plugin: .init_apps to .post_fork
trying to avoid seg_fault on very heavy load; (our workers now alloc memory for states and create it)
also our app can now work without wsapi app, it will just send 500 error code
2015-07-26 00:14:43 +03:00
Hleran 6b0a89a117 lua_plugin: lua_newthread instead of new_State
only ONE lua_State per 1 worker, and one lua thread per one worker's core.
so, 4 workers with 8000 async cores will not create 8000 lua_States, only 4, for each worker.
uwsgi table now also has lua_thread collection, and mywid variable.

Know bugs: too many simultaneously running cores (like async = 8000) without proper gc will cause segmentation fault (out of memory)
2015-07-22 21:28:25 +03:00
Hleran 59f6cd5453 lua_plugin: rpc uwsgi_malloc and missing free
I noticed that all cool kids are using uwsgi_malloc instead of malloc;
Also I noticed, that I forgot to free memory last time (while playing on high level languages)
2015-07-18 23:28:12 +03:00
Hleran 993fd384f1 some features
- rpc calls from my lua app ('local str = uwsgi.rpc(node, func_name, arg1, arg2, ...);')
- global "uwsgi.req_input_read" alias of local "env.input.read" function
- can yield numbers as well
- can return nil instead of header's table (same as {})
- can return nil or string (or number) instead of coroutine
2015-06-07 15:37:39 +03:00
Unbit ed2ca5d333 request buffer_size is now 64bit (except for uwsgi protocol) 2014-09-21 08:26:20 +02:00
Mike Kaplinskiy 1a4f333912 Allow --async 1 (i.e. sync mode, but with a different loop engine) 2014-08-17 13:13:17 -04:00
Bruno Deferrari ef12aaf13c Support for repeated headers in responses in the Lua plugin
This is needed for WSAPI conformance, and important for having
good support of Set-Cookie.
2014-04-24 17:30:09 -03:00
Unbit 1ba0935579 fixed lua prepare_headers 2013-12-28 18:39:30 +01:00
Riccardo Magliocchetti 473b4f1e57 plugins/lua: check return value of uwsgi_response_prepare_headers
Reported by Coverity as CID #1100802
2013-12-28 16:11:59 +01:00
Unbit 4e260fa8a1 fixed #476 and #477 2013-12-14 07:45:38 +01:00
Unbit bb4be12fda implemented more async api in lua 2013-12-13 11:51:05 +01:00
Unbit 672fb0eaa6 added --lua-gc-freq 2013-12-13 09:07:44 +01:00
Unbit 6e2adf9cf3 added support for async api to lua 2013-12-12 13:42:12 +01:00
Unbit 7f004c5d6d removed async_force_again from lua 2013-12-12 13:34:25 +01:00
Unbit 13e7b53c54 async_force_again 2013-12-12 13:33:37 +01:00
Unbit 1c89522519 added websocket api to lua 2013-12-12 11:16:38 +01:00
Unbit abed95362f another series of rpc 64bit fixes 2013-11-11 13:46:00 +01:00
Unbit 26386909de first attempt of moving rpc output from 16 to 64 bit 2013-11-11 13:00:20 +01:00
Natanael Copa dad97bc104 add support for lua5.2
The default is still lua5.1 but 5.2 can be picked at compile time
but setting UWSGICONFIG_LUAPC=lua5.2
2013-06-24 14:35:31 +00:00
Unbit 575fc26bd7 try to support uclibc correctly 2013-06-24 16:01:43 +02:00
Unbit 375d6ee331 allows non-request plugin to register rpc functions 2013-04-21 09:43:45 +02:00
Unbit 538ab57b6e extend magic cache api to export the expires value (if available) 2013-04-16 18:56:25 +02:00
Unbit d47c25ea4c added --lua-shell 2013-04-08 14:16:36 +02:00
Unbit b8d0e7a3ac beta quality v8 plugin 2013-03-29 19:37:33 +01:00
Unbit 59121ff834 added --lua-load, fixed lua rpc memory leak 2013-03-28 09:21:47 +01:00
Unbit 639c1a508c support for lua ordered arrays in configurations 2013-03-28 09:00:10 +01:00
Unbit 210ccd0063 allows configuration via lua 2013-03-28 08:02:07 +01:00
Unbit 3ab96621db ported magic cache api to lua 2013-03-08 19:06:36 +01:00
Unbit 8f7e5fc1bc fixed cache_update for lua 2013-03-07 13:23:24 +01:00
Kaarle Ritvanen fe0c1a4bb3 Lua binding for cache update function 2013-03-07 09:17:58 +00:00
Unbit 8e6b810df8 fixed lua plugin 2013-02-17 14:27:32 +01:00
Unbit 9f15345183 prepare dor async-friendly rpc 2013-02-07 17:23:59 +01:00
Unbit d4130dbc4b first round of protocol parsers optimizations
preliminary api for language-independent body read

another step

completed body read language independent implementation

ported gevent to the new read/write api

ported websockets to the new read/write api

removed channels subsystem

removed channels subsystem

ported lua to the new read/write api

fixed post-buffering

readline is still broken

improved request body readline

very difficult test for readline()/read() combo passed

other improvements in postbuffering/read/readline

ported --http-socket to the new api

added X-Forwarded-SSL management

removed old api

more refactoring

ported the RACK plugin to the new api

ported psgi plugin to the new api

defintely removed clustering

simpified ifdel hell

simpified ifdef hell

removed useless configuration options
2013-02-03 10:38:13 +01:00
Roberto De Ioris 4cd5643c8f ported lua to the new api 2013-01-20 13:01:23 +01:00
Kaarle Ritvanen e4642e5e56 Lua bindings for lock/unlock functions 2013-01-01 15:11:46 +02:00
root e77f1d5069 %z is not portable 2012-12-07 11:25:14 +01:00
Łukasz Mierzwa 7bb424622c few log format fixes 2012-12-06 13:55:43 +01:00
Kaarle Ritvanen e23a7bfd80 support asynchronous requests in Lua plugin 2012-11-15 14:18:45 +02:00
Roberto De Ioris 6b32ac086e improved lua plugin performance and status management 2012-10-07 08:45:50 +02:00
roberto@quantal64 689a4ef6d4 added support for lua table in the WSAPI plugin, patch by Aaron B. 2012-08-30 08:54:25 +02:00
roberto@quantal64 8e10efd027 added options for setting Expires based on REQUEST_URI and PATH_INFO 2012-06-13 10:53:21 +02:00
roberto@goyle 282b2d5ace lua fixes 2012-03-23 21:22:17 +01:00
roberto@precise64 a35335a820 fixed lua plugin 2012-03-12 18:54:04 +01:00