[nodejs] Re: Simple Memcached server in Javascript with 100 lines of code

2012-08-03 Thread Jimb Esser
Best thing to try, add --nouse_idle_notification to the node command line, this disables the full garbage collects when node tells V8 it thinks its idle, but V8's garbage collection it does on every allocation should still take care of collecting garbage. Give that a try, watch the RSS in top o

Re: [nodejs] Re: Simple Memcached server in Javascript with 100 lines of code

2012-08-03 Thread Marcel Laverdet
Yes adding --nouse-idle-notification to your node flags is definitely the first thing you should try. You may also try avoiding objects with large numbers of keys (like a million seems to be my ceiling). On Fri, Aug 3, 2012 at 8:35 PM, Jimb Esser wrote: > Best thing to try, add --nouse_idle_noti

Re: [nodejs] Re: Simple Memcached server in Javascript with 100 lines of code

2012-08-04 Thread junyi sun
Thanks you all. I have tested my code with mc-benchamrk, and I started the server like this: node --nouse_idle_notification memcached.js The benchmark score is: == SET == 100 requests completed in 24.53 seconds 50 parallel clients 3 bytes payload keep alive: 1 77.58% <= 1 mi

Re: [nodejs] Re: Simple Memcached server in Javascript with 100 lines of code

2012-08-07 Thread junyi sun
Hi guys, I have updated the code. Now, it is not just a memory store. With LRU code added, it become a real Cache Daemon. You can review the code here: https://gist.github.com/3291755 It still has many places to improve. Any idea to improve the LRU algorithm or memory management? please let me k

Re: [nodejs] Re: Simple Memcached server in Javascript with 100 lines of code

2012-08-09 Thread alessioalex
This is why I love Node so much, creating a Cache Daemon in around 200 loc is awesome. On Wednesday, August 8, 2012 6:28:50 AM UTC+3, sunjoy wrote: > > Hi guys, I have updated the code. Now, it is not just a memory store. With > LRU code added, it become a real Cache Daemon. > > You can review