-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node-persist in cluster mode #93
Comments
Pattern of node-persist is RAM+FileIO, which not designed for the "concurrent" requirement. So, an standalone writter service for appilcations which in PM2 mode is highly recommended. P.S. similar solution is also work for node-sqlite3 .... |
thanks for your answer. What do you means by "standalone writter" ? |
@microSoftware For mine scenario (Some small tools that run in PM2 that have many read actions which I don't want to introduce redis or mysql or mongodb etc), I found no better solution to solve the concurrent conflicts than make a small js-program that listen to a socket to wait for the write command, exec it and return the result. that turns it into a socket-writer-micro-service.... It amazingly works for me... hope my answer satify you, let me know if not ;) |
@wanjochan Thank you for the complete answer. It's crystal clear now 👍 |
Hi, I run nodejs on ubuntu with pm2 (in cluster mode);
When I persist data (probably on one cluster). I can't access it (probably trying to access it from the other cluster)
I know node-persist don't write the data instantly in disk. But I wait 10s, 30s, 1mn+ and i can't read the data. But if I reload both cluster, every data are accessible.
So my guess is that when node start, node-persist write in RAM all the files in .node-persist/storage/ which explain why it works when I restart.
Is this the intended behaviour when running node-persist in cluster mode ? if so, is there option/work around for this ?
thank you for your help :)
The text was updated successfully, but these errors were encountered: