hello,

... not to be construed as a "shameless self-promotion" :) consider this a
Friendly Neighborhood Notice:

https://github.com/xtfxme/gridfuse

STORY: we use mongodb at $DAYJOB for some app logging/misc, but i hadn't
heard of GridFS until the uWSGI plugin was announced. to aid
experimentation/ease-of-use, i searched for a FUSE impl, enabling me to
"charge" GridFS with a TONS of files... but alas... i didn't find any
working impls, just outdated and/or incomplete ones.

...so, like any self-respecting developer, i started by modifying an
exiting impl, but soon after is was 100% reimpl'ed, and met the bar.  see
above...

it may prove useful to others! it's complete enough to run my full
development environment with surprising perf.

RAND:
 - 120sec / 815MiB / ~6200ino ... `cp -a devel/venv mnt/devel/venv`
 - 20sec / 448MiB / 1ino ... `cp -a prod.sql mnt/prod.sql`
 - 18sec / -- / ~6200ino ... `tree -a mnt/`
 - 6sec / -- / ~2300ino ... `tree mnt/`

CAVEATS:
 - no hard link()s
 - doesn't currently check/enforce permissions well (...at all)
 - inefficient mongodb usage... needs proper indexes
 - inefficient architecture... i didn't realize until 3/4 done that GridFS
doesnt actually support file updates; it masks old files with a "newer"
file by the same name.. depending on the app's access patterns, creating a
file can lead to 1-2 empty "old" files + your current file :(

ADDTL:
...FTW, the impetus here was to experiment with sys.meta_path +
uwsgi.FUNC(...) [FUNC=connect maybe...] to essentially load the entire
python stdlib via a loopback call to uWSGI, which would then fetch the file
from GridFS...

...i've still not actually tried this part yet (i've done sys.meta_path
stuffs multiple times, but unsure if i can set early enough to load
stdlib...) but the end-goal was some sort of dynamic/instantaneous code
rollout/recovery/reset thinger, where a rollout would become... set new
collection name + reload + PROFIT!

in closing, i would be interested in hearing any similar/alternative ideas
implemented/thought-of by others.

thanks,

-- 

C Anthony
_______________________________________________
uWSGI mailing list
uWSGI@lists.unbit.it
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to