Hi,

I've installed DrupalChat module and I've found out that after a short period of time browsing my website, DrupalChat eats up all my server resources then immediately the site will goes down, I've attached the screenshot here for you to take a look and see what is actually happening.

On my observation, it ends up opening too many PHP process, maybe an endless loop.

Here's what the screenshot is all about:

1 - Before Drupal chat is installed and browsing the site, stable memory
2 - After Drupalchat is installed and browsing the site (opens up too many PHP process)
3 - While browsing the site (Memory continuously goes up and after some time, server will goes down because its out of memory).

Comments

darklrd’s picture

Try out the latest dev please - 7.x-1.x-dev.

danreb’s picture

Hi, I've tried the development version and the problem doesn't exist there.

Test on this two configuration options:

1.) long polling - memory goes up to 580M when chat is active and 2 users having a chat conversation but it immediately goes down, I think this is normal cause when PHP process end, its free up server memory

2.) Normal Ajax - Wow, almost not consuming server memory at all

I ended up choosing the Normal Ajax as it's not as resource hungry than long polling, although I have node.js installed on my server, I am not able to test how it performs cause I did not done configuring it.

Drupal website users normally install and download the stable version of the module so I suggest you'd better backport immediately all the changes from the dev to the stable release as this problem may cause their website to goes offline.

Thanks.

darklrd’s picture

Status: Active » Fixed

Hi,

Thanks for testing the dev. I think long polling should also not cause any problem. Do you have any estimate as to how much memory is used when 2 users chat?

I will commit the code soon to stable release. Marking this as fixed. Thanks.

danreb’s picture

long polling eats 1.7% of memory each PHP process as I've seen in WHM, when 2 users chat these PHP process increase up to four then immediately goes down to 2, base on this I'm concluding that the memory consumption will be:

4 PHP process with 1.7% each(2 users chat)

1.7 * 4 = 6.8%

Memory goes up to 580M, then goes down to 330M immediately

580 * .068 = 39.44MB

_______________________________

If my assumption is right long polling eats approximately 20Mb - 40Mb of server memory when 2 users is active on chat. Is this normal? If this wouldn't increase base on users, then I think its fine, but I'm not able to test it with many users chatting cause my website is under development and on a password protected directory by now.

Glad that Normal Ajax is working fine and do not eats server memory haha :), so I can live with that by now.

Thanks.
Danreb

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

thermador’s picture

Version: 7.x-1.0-beta2 » 7.x-1.0-beta10

Reopening this issue.

DrupalChat, using Ajax or Long Polling, consumes a ton of memory (server ram, non php memory). I also set up a "free" account on the iFly server and changed the polling method, but the memory hogging remained.

I will continue my research today and post some data, but this is what I've seen using the devel module, the memory profiler module, going into the server via SSH and typing "free -m" and "top -c", etc.

How do I stop DrupalChat from sucking down the memory? I am on a VPS and I would like to not have to pay for 4GB of RAM for DrupalChat...

thermador’s picture

Status: Closed (fixed) » Active

Ok really reopening it, forgot to set status to "active"

darklrd’s picture

thermador,

if possible please come on demo site so that we can discuss this. I am currently online.

Thanks
Shashwat

darklrd’s picture

Status: Active » Fixed

As discussed with thermador, ajax polling method seems to be working fine. Marking this as fixed. Please re-open if there is any issue. Thanks.

thermador’s picture

Yeah I have to say, memory use came down quite a bit when I switched to the iflychat server. Also, the chat has a lot more features.

Overall though, I was really impressed by the level of support for getting my chat going and fixing the theme. These guys do a great job.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

adamtong’s picture

Hi, the drupalchat also consume tons of my server memory. The CPU time is over 450 minutes per day. (before install, just about 50 minutes per day)

Thank you.