Yeah its quite random but I can come up with a standalone script. Basically I feel the object needs to be in memory for long to be moved on old gen space or something. Anyway, will try to repro this outside of my application.
> I'm not sure I understand what you mean, but nothing is magically becoming non-blocking here. > If you're concerned about doing multiple concurrent INSERTs I'd suggest to use an AUTO_INCREMENT key. You can get the automatically created key with this<https://github.com/felixge/node-mysql#getting-the-id-of-an-inserted-row>. The current approach seems exceptionally brittle and non-scalable. - I meant non-blocking for the requestor. I can respond to him immediately with a random_id rather than wait for mysql's auto-incremented id. Esp useful during db slowdowns or failures. > you're making synchronous callbacks which is entirely inappropriate here. I don't see why you'd want these functions to appear asynchronous, but you should at least use .nextTick() the callback. - I don't want the function to be async, it is completely sync in generating a random id for me, except the case when the key "table_name" does not exist in the dictionary, at which point is has to query the db to load all previously created keys. (can only happen on process restarts) The generateUniqueRandom is just an inner function in the actual function which takes care of loading if needed and all. > recentRequestIds[table_name] is never initialized with an object. clearRecentRequestIds deletes the key instead of setting it to an empty object. - It is initialized by the generateUniqueRandom's enclosing function if needed. I delete the key coz that key is for previous day. It will never be reused. The table name is different each day. Data is sharded per day and there is no limit to how many days in future the data can be. So, I create a new table for each day and have date appended to the name. Anyway let me try to come up with a standalone stript that mimics our application. Only thing that will be hard to incorporate is the high number of http requests to the app, if at all its relevant. -Sumit -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
