Advertisement:

Author Topic: Osclass Extreme Memory Usage with Multi-Country  (Read 6187 times)

Aficionado

  • Guest
Osclass Extreme Memory Usage with Multi-Country
« on: September 05, 2015, 12:47:09 am »
As you can see in the image capture, i (try to) run one Osclass with 22 countries. Right now it has less than 2000 ads, so it is practically empty.

BUT i hit memory limits all the time. I increased from 256 to 392 and now to 512. The errors of short memory are when adding a listing or Editing a listing and who knows where else. I run 2 plugins, nothing special, same as my other 4 Osclass installations (not multi-country).

I'm not a programmer but I think a better strategy of countries/regions/cities should be adopted by Osclass. It is absurd to need 512mb of memory just to Edit a post. All themes i have tried.

Or maybe it is a bug somewhere ?


 

« Last Edit: September 05, 2015, 12:51:20 am by Aficionado »

Aficionado

  • Guest
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #1 on: September 05, 2015, 12:55:27 am »
Here are some errors, very strange, because when i increase the allowed memory, the "needed" memory also increase (in the error). Doesn't seem right to me.

[04-Sep-2015 18:32:52 Europe/London] PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 87 bytes) in /home/oc-includes/osclass/classes/database/DBRecordsetClass.php on line 186

[04-Sep-2015 18:33:49 Europe/London] PHP Fatal error:  Allowed memory size of 411041792 bytes exhausted (tried to allocate 7864320 bytes) in /home/oc-includes/osclass/frm/Form.form.class.php on line 26

[04-Sep-2015 18:38:08 Europe/London] PHP Fatal error:  Allowed memory size of 411041792 bytes exhausted (tried to allocate 7602176 bytes) in /home/oc-includes/osclass/frm/Form.form.class.php on line 26

The above two last errors are with 392 mb. Now i'm at 512 and that is the max i can have. But with 512 of memory, with several visitors at once, it will crash again.
« Last Edit: September 05, 2015, 12:57:36 am by Aficionado »

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #2 on: September 05, 2015, 01:07:21 am »
Mmmm not good.
Do all these countries and subs get loaded in item post/edit page? (that could be a memory hog)

Regards,
Eric

Aficionado

  • Guest
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #3 on: September 05, 2015, 01:11:02 am »
Mmmm not good.
Do all these countries and subs get loaded in item post/edit page? (that could be a memory hog)

Regards,
Eric

Eric i have no idea how Osclass works, as i said i'm not a programmer. I only know my way around php code, as needed for a webmaster.

And apart from France, Germany and Italy, the rest of countries have little data as regions/cities.


frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #4 on: September 05, 2015, 01:53:19 am »
@Aficionado
There are 2 options (I think) locations can be loaded, depending on theme:
1) countries, regions and cities are loaded when item_post.php is opened > this is very bad when there is many locations
2) countries are loaded, regions & cities are loaded via ajax on request (when you choose Germany, only regions from Germany are loaded)

Second should not cause problems with locations. It might be good to enable sql debug on your osclass to see what SQL queries were called on page load.

Aficionado

  • Guest
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #5 on: September 05, 2015, 04:03:54 am »
@Aficionado
There are 2 options (I think) locations can be loaded, depending on theme:
1) countries, regions and cities are loaded when item_post.php is opened > this is very bad when there is many locations
2) countries are loaded, regions & cities are loaded via ajax on request (when you choose Germany, only regions from Germany are loaded)

Second should not cause problems with locations. It might be good to enable sql debug on your osclass to see what SQL queries were called on page load.

Both Modern and OsclassWizards theme seem to use (2). Not 100% sure, but i think they do.

Memory problems with multi-country exist from the day i joined Osclass users. I do remember 2+ years ago opening a github issue about the recalculations stats during cron that crashed with more than 3-4 countries. Daniel did a mod in Osclass do to that in several "pieces" and not at once.

But i see now that i'm hitting an other wall, again with memory. And i can't go beyond 512mb.

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #6 on: September 05, 2015, 10:40:35 am »
@Aficionado
That is the issue with locations that there can be a lot of them... Were you able to setup sql debug?

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #7 on: September 05, 2015, 03:25:52 pm »
There is one other option, some kind of memory leak on your server either your own or when on shared hosting due to some other site.
Also it is possible system is not releasing used memory meaning a steady memory growth leading up to memory boundary, looks like a leak but actually is different.

I *think* 512 should be enough for your setup, can you have a look in your cpanel and see memory usage per application or something before it crashes?


Regards,
Eric

Aficionado

  • Guest
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #8 on: September 05, 2015, 05:21:22 pm »
@Aficionado
That is the issue with locations that there can be a lot of them... Were you able to setup sql debug?

I did but nothing was written and no file was created. Strange, i will see this during the weekend.


Aficionado

  • Guest
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #9 on: September 05, 2015, 05:28:50 pm »
There is one other option, some kind of memory leak on your server either your own or when on shared hosting due to some other site.
Also it is possible system is not releasing used memory meaning a steady memory growth leading up to memory boundary, looks like a leak but actually is different.

I *think* 512 should be enough for your setup, can you have a look in your cpanel and see memory usage per application or something before it crashes?


No, that is not a hosting problem, but an Osclass problem (or a theme problem).

Of cource 512 is enough for my case, that is why i try  figure this out. The memory usage on my server is low, less than 100-150 mb and i'm on a clould linux. Cloud Linux pretty much isolates at 99% the hosting plans so they can't mess up with each other. No one can (for example) overtake the server CPU / Memory etc etc.


SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #10 on: September 05, 2015, 05:34:26 pm »
Okay, so you have same issue with other theme(s) or is there a theme where you do not have this issue?

Aficionado

  • Guest
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #11 on: September 05, 2015, 05:38:11 pm »
Okay, so you have same issue with other theme(s) or is there a theme where you do not have this issue?

I have tried Modern theme, Bender and OsclassWizards free theme. It happens in all of them. But OsclassWizards is based on Bender, so if Bender has this bug then it was inherited to others also.


SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #12 on: September 05, 2015, 05:45:22 pm »
Mmmmzzz sounds like a core issue more than a theme issue, besides what already has been said I have no clue what could be bugging...

Aficionado

  • Guest
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #13 on: September 05, 2015, 05:53:32 pm »
@Aficionado
That is the issue with locations that there can be a lot of them... Were you able to setup sql debug?

Ok, for some reason the log file had to be created (initially) manually and here it comes.

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #14 on: September 05, 2015, 06:29:51 pm »
@Aficionado
I have checked your file and found that there is more queries running for long time (8 or more seconds), there is probably relation to city table in all of them. It is very strange.