Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need your opinion! I am creating a chat application for a large community of several million people. I need to find the best way to have a very good performance. I plan to store conversations in temporary text files, and when the chat is terminated, the system stores the conversation into a PostgreSQL DB and deletes the text file. There will be thousands of text files, and I am concerned with I/O overhead fron the HDDs. Maybe this won't be a problem if text files are stored in RAM while they are read/written. Do you know how Linux handles those files that are heavily read and written? Another way would be querying the DB directly but I would need a whole lot more hardware I guess.
What do you think is best to handle a lot of queries like this, and does Linux keep in RAM files that are heavily accessed (provided that there is enough RAM)?
For best performance in a large scale chat application, it's best not to even receive the chat messages in the first place. Is there some reason it's not acceptable to design it so the clients directly communicate with each other?
Even if you use centralized communications, why bother storing conversations at all? If you're going to be deleting them at the end, then obviously you're not concerned with long term storage.
Thank you Isaac, we are limited by the web technologies, I don't know how to have two users communicating with each other using just a browser (unless using an applet, but I don't want that anymore).
If they even could communicate directly, there would be other problems anyway (firewall blocking, etc...).
I need to centralize the chat so that conversations go through the server and so that I can store them because people need to be able to browse/search through previous chats.
Which web technologies are you using? I'm not an expert in web application development, but I know enough to know that anyone giving you advice would benefit from knowing what you're using.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.