> hello, > > > in 0.9.9 there was mention of being able to append binary data to the > uwsgi binary; was this specifically in reference to embedded modules? > i'd like to be able to append a compressed image to the binary which > could "self-extract" into a complete environment (including cpython, > and later pypy). >
Hi, currently there are two way to embed data (generic data, not only modules), via symbols or via attaching. The first one is more complex but extremely fast (expecially when you use it as a module loader). The second one is more easy and do not require to rebuild the uWSGI binary. Praticaly you "append" to the binary, the output of the attach.py script: attach.py myfile.zip > blob cat uwsgi blob > newuwsgi >From now one 'newuwsgi' can access the binary blob using the data:// url: data://0 will be the last file appended (they are parsed in reverse order). You can do something like ./newuwsgi --ini data://0 or ./newuwsgi --import data://0 and so on. > is something like this possible right now? i'll be experimenting more > but i already spend hours drooling over the options+potential :-) ... > i mainly want to make sure the appended image isn't consuming > excessive (optimally zero) memory. in attaching mode you will not consume memory until you read the file. In symbols mode the memory is directly part of your process address space. So all of the embedded files are loaded in memory on startup. By the way, this area is a total work in progress (most of the ideas are from Cal Leeming of Simplicity Media) so feel free to push your work/problems/suggestions here -- Roberto De Ioris http://unbit.it _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
