Memory Limit

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

[size=4]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 = [/size]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.

[size=4]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.[/size]

So 1024MB is verry high.



Hope this helped you further

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

[quote name='eComLabs' timestamp='1425290725' post='206753']

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

[/quote]



thank you for your help.

[quote name='Anaconda' timestamp='1425245919' post='206704']

[size=4]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 = [/size]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.

[size=4]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.[/size]

So 1024MB is verry high.



Hope this helped you further

[/quote]



are you sure that this settings are per client?

[quote name='eComLabs' timestamp='1425290725' post='206753']

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

[/quote]

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

[quote name='demeldoo' timestamp='1425406230' post='206967']

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

[/quote]



It works on my installation

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 :)

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.

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 [color=“000000”](used 14.3 GB)[/color] [color=“000000”](Inode 30%)[/color] (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?

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

[quote name='eComLabs' timestamp='1425548323' post='207163']

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



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

[/quote]



No, will check it out. Thank you

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.

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.

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

[quote]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[/quote]

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! :-)

Guys,

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

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.

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

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.

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

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.