High system resource usage check.

Status
Not open for further replies.

ikromm

New Member
Messages
20
Reaction score
0
Points
0
Greetings,

I'm experiencing high system resource usage. I just received my 2nd warning and as i can see, soon there would be a 3rd one. Is there any way someone can check where in the script the usage is high?

The script is mine. Being a developer, are there any tools that can do that work?

Thank you in advance

-ikromm
 

drosado

New Member
Messages
36
Reaction score
3
Points
0
Are you running anything via CronJobs? If so turn down some of the refreshes.
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
How often does the script run? Cron job? Called by Ajax? Connect to database?
Loops are often the culprit. If something uses up memory inside a loop, you can easily get a large footprint (note: if you run out of memory, that often saves you from getting suspended since your script crashes and no longer hogs memory ).
 

ikromm

New Member
Messages
20
Reaction score
0
Points
0
I do not have any cron jobs but i use a lot of ajax.

I suppose that since i still end up suspended ram is not the problem.

Probably the problem is the database. When I want to load up a query i connect and then disconnect.

Would it be better to leave the connection open?
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
I do not have any cron jobs but i use a lot of ajax.

I suppose that since i still end up suspended ram is not the problem.

Probably the problem is the database. When I want to load up a query i connect and then disconnect.

Would it be better to leave the connection open?

It is not advised to leave the connection open.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
I do not have any cron jobs but i use a lot of ajax.

I suppose that since i still end up suspended ram is not the problem.

Probably the problem is the database. When I want to load up a query i connect and then disconnect.

Would it be better to leave the connection open?

Define "a lot of ajax". If you use ajax to call the server every couple of seconds and you have 5 users, that adds up to a lot of calls.

Ram can be a problem. If your loop eats up enough memory but does not exceed the script limit (and crashes), it will run into problems since the system will notice the consisently high usage. I was talking about scripts that quickly run out of memory and crash.

And you still haven't described exactly what your script does or how often it is called by a webpage.
 

ikromm

New Member
Messages
20
Reaction score
0
Points
0
I use ajax only for a smooth transition between pages.

The maximum number of loops in the scripts are at most 10.
As I think it the problem might be some "persistent" classes that exist in the site.
Their data are always loaded.

The site is a browser game i' m building, still in construction - not even alpha, and I wanted to make some tests to see it on real time environment.

--------------------------------------------

As I have seen in my dev machine, the queries for a single page can be over 50. Meaning that the db will open and close 50 times for a single page ~ a few seconds that is.

Could that be the problem?
 
Last edited:
Status
Not open for further replies.
Top