For several projects in Colombia we have the following facility: https://docutopia.tupale.co
Sometimes when I try to log in I get the message: I’m busy right now, try again later.
I have codimd running using systemd as indicated in this document: https://demo.codimd.org/svq0JObCToqyt3ZBCZ58og#
I would like to run it using PM2 to give it more resources but I have not been able to get codimd to run it the same way using pm2. Since I don’t know how to allocate more resources using npm start, I don’t know if anyone has experience in this and can share something with me to solve this problem.
This message usually indicates that CodiMD spends too much time processing data on the event loop. This can happen when your CPU is rather busy. If you see this too often and your CPU is not busy, consider increasing the threshold in your config.json using the tooBusyLag option.
Please note, that CodiMD is a NodeJS program which means it’s single threaded and doesn’t explicitly benefit from multi-core system. More important would be single-core performance.
I can’t give you a recommendation here, as it probably needs some tinkering. Maybe double it, maybe even triple it. In the best case the screen will just disappear, in the worst case editing will be a bit more stuck. It depends on many factors as your CPU clock speed, the architecture, IO can factor in, number of users, document size, how you serve your uploaded images, etc.
This is why I would like to run it with PM2 because it can take advantage of pm2’s functions to create forks or multiple instances of node applications, but when I run it with pm2 the socketio breaks and writing to the application doesn’t work.
CodiMD is not made to be scaled like that. We keep state in the node process which can not easily be shared (such as currently connected users to a document, current state of the edited document, etc). Please don’t run multiple instances of the application as this will mess up your documents for sure.
While you can indeed browse the repository, you also could use the docs website over at https://docs.hedgedoc.org, which for example also includes search functionality.