[Kss-devel] Optimizing polling with kss timeout
Godefroid Chapelle
gotcha at bubblenet.be
Tue Jun 12 15:11:20 CEST 2007
jc at upfrontsystems.co.za wrote:
> Hi Everyone,
>
> I'm busy writing an instant messenger client for Plone using kss.
>
> The messenger makes use of polling (using kss timeout) to ask the chat
> service (that stores the messages) whether there are any new messages
> for the currently logged in member.
>
> The kss:
>
> div#message-area:timeout {
> evt-timeout-delay: 2000;
> action-server: kss_update_message_area;
> kss_update_message_area-contact: currentFormVar('contact_id');
> }
>
> When I shutdown the zope server that the messenger is running on, the
> browser continues to poll. This causes the cpu usage of my pc to spike
> every time a timeout fires. By compacting several kss entries into the
> one you see above and then calling only one script, I've been able to
> bring these spikes down to about 50% (they were above 90% before) of
> total cpu usage.
I had seen cpu issues with the timeout event but never reported it myself.
To avoid this type of situation where info gets lost, I have asked
Balazs to setup poi on kssproject.org.
He will tell this list when it is done.
Can you, at that time, file the issue ?
>
> Does anyone else have any advice of suggestions on how to further
> reduce the cpu load on the client side?
>
> AFAIK the trunk has been merged with comment stripped code. Can I use
> a checkout of the trunk as it is currently, for usage in a production
> environment and will it have a significant impact on the cpu issue?
AFAIK, Balazs was already using the stripout-comments branch in production.
However, I doubt it will have any impact about the timeout cpu issue.
>
> Thanks in advance
> JC
--
Godefroid Chapelle (aka __gotcha)- BubbleNet http://bubblenet.be
More information about the Kss-devel
mailing list