Forum Moderators: open

Message Too Old, No Replies

AJAX & PHP (More Speed Required)

I Need to put an F1 Engine in my AJAX

         

colandy

9:35 am on Jun 15, 2007 (gmt 0)

10+ Year Member



OK, it's tough but someone has to do it. I have an AJAX, JS and PHP Chat application that just works a treat has a few additional features at the mo like Private chat, messaging(mail) and so on. Looking to add themes, profiles, and text features later.

However, I do seem to have an issue with Speed, it would appear that my Reliant Robin needs a Maclaren F1 engine (Now there's a thought).

There are around 6 to 8 AJAX objects in the main chat window, 3 are updating every 2 or 5 seconds, if a Private Chat request is placed that checks every 2 seconds until a response is detected, others are all as and when.

On localhost the speed is fine'ish until you open a private chat at which point you get another 3 AJAX Objects per Private Chat.

The application does not use XML to pass info all data in a MySQL database accessed via PHP. Would closing the Objects make a big difference seeing as they are re-created every few seconds anyway..?!?!?

geofflee

11:56 am on Jun 17, 2007 (gmt 0)

10+ Year Member



Don't use a PHP and AJAX combination for creating a real-time chat application because this requires the client to poll the server every few seconds. This is extremely inefficient, and that is why your application is running so slow.

Instead, you should use Flash or Java applets for your chat client and something like Java EE or Coldfusion for your server. This allows the server to push data to the clients only when something has changed.

-Geoffrey Lee

vincevincevince

12:49 pm on Jun 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Make sure you are not using or declaring sessions in any form.

colandy

4:16 pm on Jun 17, 2007 (gmt 0)

10+ Year Member



Bit hard not to use sessions as it controls the members area.

Would love to use coldfusion but don't know it and finding a host that's cheap with coldfusion could prove awkward.Guess I'll just have to find a way without sessions.

Thanks for the suggestions.