Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Memory Limit Rate Topic   - - - - -

 
  • demeldoo
  • Senior Member
  • Members
  • Join Date: 27-Jul 12
  • 914 posts

Posted 01 March 2015 - 02:33 PM #1

hi guys,

can someone explain what this lines are meaning

if (PHP_INT_SIZE == 4 && (substr(ini_get('memory_limit'), 0, -1) < "64")) {
// 32bit PHP


} elseif (PHP_INT_SIZE == 8 && (substr(ini_get('memory_limit'), 0, -1) < "256")) {
// 64bit PHP


do we have to increase memory like this way:

// Set maximum memory limit
if (PHP_INT_SIZE == 4 && (substr(ini_get('memory_limit'), 0, -1) < "64")) {
// 32bit PHP
@ini_set('memory_limit', '1024M');
} elseif (PHP_INT_SIZE == 8 && (substr(ini_get('memory_limit'), 0, -1) < "256")) {
// 64bit PHP
@ini_set('memory_limit', '1024M');
}

or do we have to change also 64 and 25 to 1024????


thank you in advance

 
  • Anaconda
  • Senior Member
  • Members
  • Join Date: 19-Sep 14
  • 151 posts

Posted 01 March 2015 - 09:38 PM #2

This meaning its the configuration for the memory_limit of PHP running as an Apache module to server webpages has to take into consideration how many Apache process you can have at the same time on the machine.
The MaxClients configuration option for Apache =
If MaxClients is 100 and you have 2,000 MB or RAM, a very quick calculation will show that you should not use more than 20 MB (because 20 MB x 100 clients = 2 GB or RAM, ie the total amount of memory your server has) for the memory_limit value.
And this is without considering that there are probably other things running on the same server, like MySQL, the system itself, ... And that Apache is probably already using some memory for itself.
So 1024MB is verry high.

Hope this helped you further

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17363 posts

Posted 02 March 2015 - 10:05 AM #3

Please go to admin.php?dispatch=tools.phpinfo and check the current memory limit which is used with this configuration

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • demeldoo
  • Senior Member
  • Members
  • Join Date: 27-Jul 12
  • 914 posts

Posted 02 March 2015 - 11:20 AM #4

Please go to admin.php?dispatch=tools.phpinfo and check the current memory limit which is used with this configuration


thank you for your help.

 
  • demeldoo
  • Senior Member
  • Members
  • Join Date: 27-Jul 12
  • 914 posts

Posted 03 March 2015 - 12:37 PM #5

This meaning its the configuration for the memory_limit of PHP running as an Apache module to server webpages has to take into consideration how many Apache process you can have at the same time on the machine.
The MaxClients configuration option for Apache =
If MaxClients is 100 and you have 2,000 MB or RAM, a very quick calculation will show that you should not use more than 20 MB (because 20 MB x 100 clients = 2 GB or RAM, ie the total amount of memory your server has) for the memory_limit value.
And this is without considering that there are probably other things running on the same server, like MySQL, the system itself, ... And that Apache is probably already using some memory for itself.
So 1024MB is verry high.

Hope this helped you further


are you sure that this settings are per client?

 
  • demeldoo
  • Senior Member
  • Members
  • Join Date: 27-Jul 12
  • 914 posts

Posted 03 March 2015 - 06:10 PM #6

Please go to admin.php?dispatch=tools.phpinfo and check the current memory limit which is used with this configuration

on 4.2.4 this tools.phpinfo is not loading. is there another way to check?

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17363 posts

Posted 04 March 2015 - 10:33 AM #7

on 4.2.4 this tools.phpinfo is not loading. is there another way to check?


It works on my installation

http://clip2net.com/s/3dzcFLu

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • demeldoo
  • Senior Member
  • Members
  • Join Date: 27-Jul 12
  • 914 posts

Posted 04 March 2015 - 12:29 PM #8

Is it possible that cs cart is ignoring settings in the config.local or servers configuration file?

I have created a php.ini in the root folder of my cs cart and my problems went :)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10595 posts

Posted 04 March 2015 - 09:40 PM #9

cs-cart doesn't care what the current php config is. It sets memory and timeout values for it's needs. If the underlying php installation doesn't support the request then it is ignored and the definitions for php from the php.ini file are used.

Note that ALL instances of PHP will ingore requests to set memory beyond a system imposed limit. It will silently fail. You can follow a ini_set() request by doing an ini_get() and seeing what the resulting value is. I.e. if you do an ini_set('memory_limit', '256M') you might find that an ini_get('memory_limit') returns '64M' which would be the system imposed limit.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3106 posts

Posted 05 March 2015 - 06:34 AM #10

Does anyone have recommendations how to make cs-cart be faster on VPS with many resources?

Server details would be
CPU: 22.80 GHz (12 x 1.90 GHz) RAM: 8192 MB + 4096 MB SWAP (used 4542 MB) HDD: 320 GB (used 14.3 GB) (Inode 30%) (20 MB/s, 200 IOPS) Network: 100 Mbps

4.2.2 cart still feels very slow. What settings should I tweak to increase limits if such exists?

4.5.2 SP2


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17363 posts

Posted 05 March 2015 - 09:38 AM #11

Darius, did you check this article from Alt-team?

http://www.alt-team....cart-users.html

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3106 posts

Posted 05 March 2015 - 12:16 PM #12

Darius, did you check this article from Alt-team?

http://www.alt-team....cart-users.html


No, will check it out. Thank you

4.5.2 SP2


 
  • kickoff3pm
  • Senior Member
  • Members
  • Join Date: 18-Aug 10
  • 682 posts

Posted 05 March 2015 - 05:21 PM #13

A few things that worked for me, I'm on shared hosting :-)

Make sure in your setting file your not storing the cache in the database except for the ADMIN end.

Sign-up and use Amazon cloudfront.

If you have a VPS install Varnish giving it 1gb in the disk.

In your PHP setting make sure Zend or APC is enabled but not both.

Remember your site won't be up to speed till the cache has built well enough so when you clear the cache visit at least the main category section to help it along :-)

Remove addons & blocks you don't really need, things like latest products, who bought what can always be added back later once the site has settled down.

Remove options you don't need in sorting, narrow down the listing to as few as you can, if you need a long listing consider making your listing thumbnail side smaller.

For me the biggest problem is the admin, it's like mud when trying to work with products and exports and import time out unless I do them from the server.
http://matchdaymemories.com - Football Memorabilia Via Cs-Cart V3
http://www.outadwords.com - Free Marketing For You Site.
http://www.alternativestoebay.com - Join The Free Ecommerce Community.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10595 posts

Posted 05 March 2015 - 07:06 PM #14

If your time to first byte is slow, then improving performance of your DB is probably the area to focus on.
With a VPS, you have full control over what percentages of your resources are used for what activities. I.e. you can allocate more memory to mySQL (biggest bang for the buck), you can configure it to use a separate file system for temporary tables and other properties can be tweaked to significantly improve performance. Like most things, the more of mySQL that you can keep cached in memory, the faster it will perform. Also, you don't want it blocking on requests while it writes stuff out to disk either. So finding the correct balance of receiving requests and then executing and delivering those requests is critical.

Your hosting company should be able to help you determine what resources you are getting short on. A good mySQL guru for contract help is always a blessing too.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10595 posts

Posted 05 March 2015 - 07:15 PM #15

Great tips (though I'm not sure Cloudfront is a performance enhancer...).

Remember your site won't be up to speed till the cache has built well enough so when you clear the cache visit at least the main category section to help it along

I would also suggest that you add a product to the cart and then go to checkout after clearing the cache. Checkout uses a lot of templates so getting them compiled and cached is important. But your first order will do that for you if they get that far! :-)

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • demeldoo
  • Senior Member
  • Members
  • Join Date: 27-Jul 12
  • 914 posts

Posted 14 March 2015 - 02:16 PM #16

Guys,
Is this true that the ini set shoulb be minimal and is applied for every client when cart is executed ?

 
  • kickoff3pm
  • Senior Member
  • Members
  • Join Date: 18-Aug 10
  • 682 posts

Posted 14 March 2015 - 06:08 PM #17

Cloud front is an enancer for me because there servers are fast then mine and it's a benfit to everyone because it adds a second domain datastream. This basicly means while your own site is delivering the code the images are being sent from another.

I'm not sure about the PHP.INI I'm not clued up in what the cscart code does in most cases but I suspect the setting is an attempt to apply a minimum setting in most cases. That doesn't mean I think you should increase or that doing that will be a benifit. Just a guess based on what cs-cart need to perform at all well.
http://matchdaymemories.com - Football Memorabilia Via Cs-Cart V3
http://www.outadwords.com - Free Marketing For You Site.
http://www.alternativestoebay.com - Join The Free Ecommerce Community.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10595 posts

Posted 14 March 2015 - 07:25 PM #18

Is this true that the ini set shoulb be minimal and is applied for every client when cart is executed ?

It should actually be a maximum setting related to the needs of your store.

It is a "limit", not a fixed allocation. So if you had 4096M, that would be the point where your process would terminate.

For the most part, cs-cart will only use 64MB or so of memory. However, when you do things like exports or other data intensive activities, it keeps that data in memory before being written out. So you have to set things for the maximum anticipated need.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • pradeesh_72
  • Member
  • Trial users
  • Join Date: 15-Nov 17
  • 39 posts

Posted 29 May 2018 - 11:27 AM #19

My production server memory is getting exhausted even after setting memory limit to 1 GB. What could be wrong?



 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3603 posts

Posted 29 May 2018 - 02:52 PM #20

My production server memory is getting exhausted even after setting memory limit to 1 GB. What could be wrong?

 

The error log will tell you what's causing high memory then you need to go from there to figure out how to fix it.