From: PFC <lists@peufeu.com>
To: Marcos <mjs_ops@gmx.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Decide between Postgresql and Mysql (help of
Date: Tue, 28 Mar 2006 23:18:39 +0200
Message-ID: <op.s646tdodcigqcu@apollo13> (raw)
In-Reply-To: <1143564928.1241.28.camel@servidor>
References: <1143559902.1241.16.camel@servidor>
<1143572392.3625.79.camel@state.g2switchworks.com>
<1143564928.1241.28.camel@servidor>
>> So, what exactly are you planning on doing?
>
> The application will be a chat for web, the chats will be stored in the
> server. In a determined interval of time... more or less 2 seconds, the
> application will be looking for new messages.
>
> I believe that it will make many accesses. The write in disc will be
> constant.
Ah, cool. That's exactly what a database is not designed for xD
Try this, I coded this in about 1 hour as a joke last week.
http://peufeu.com/demos/xhchat/
It works in firefox and opera, uses xmlhttprequest, and the messages are
stored in a dbm database.
We have also coded a real HTTP chat. I'll briefly expose the details
on-list, but if you want the gory stuff, ask privately.
There is a Postgres database for users, authentication, chatrooms and
stuff. This database can be modified by a full-blown web application.
Of course, messages are not stored in the database. It would be suicidal
performance-wise to do so.
An asynchronous HTTP server, using select() (lighttpd style) is coded in
Python. It is very special-purpose server. It keeps an open connection
with the client (browser) and sends messages as they arrive in the
chatroom, with no delay. The connection is interrupted only when the
client submits a new message via a form, but this is not mandatory.
My memories are a bit old, but we benchmarked it at about 4000
messages/second on a low-end server (athlon something). Concurrent
connections are unlimited. Disk I/O is zero. I like it.
If you store messages in the database, you can hope to be about 10-50
times slower.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: lists@peufeu.com, mjs_ops@gmx.net
Subject: Re: Decide between Postgresql and Mysql (help of
In-Reply-To: <op.s646tdodcigqcu@apollo13>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox