You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In nginx+lua mode, I use lua_resty_upload to receive post files over, I want to save the received file into memory, then write directly to the distributed file system i.
So less write files to the local hard disk and read files from the local hard disk, reduce I/O, improve the efficiency of.
How to save post files over to the memory, how to achieve this!,
The text was updated successfully, but these errors were encountered:
@andaok Hopefully you're not buffering the whole request body at once in memory because that'll be too expensive for large inputs. The recommended way is do non-buffered processing (or streaming processing) such that a (small) constant size of memory is used regardless how big the total stream is.
To be more specific, you can first read a data chunk (say 4KB or 8KB) from lua-resty-upload, and then write it out via cosockets nonblockingly to the backend immediately, and then read the next data chunk and so on.
Hopefully your "distributed file system" exposes a socket endpoint otherwise file IO related syscalls will almost always be blocking.
In nginx+lua mode, I use lua_resty_upload to receive post files over, I want to save the received file into memory, then write directly to the distributed file system i.
So less write files to the local hard disk and read files from the local hard disk, reduce I/O, improve the efficiency of.
How to save post files over to the memory, how to achieve this!,
The text was updated successfully, but these errors were encountered: