I know Magento requires good amount of resources for better performance. But i wanted to know how much does an indexing process should take for a store that has around 22K products.

I have run indexing process via SSH and found the process is not completed due to lack of memory. I have already allocated 2GB, isn't this enough?

below is the output of indexing via SSH

 [~/public_html/shell]# php indexer.php reindexall
Product Attributes index was rebuilt successfully
Product Prices index was rebuilt successfully
Catalog URL Rewrites index was rebuilt successfully
Category Flat Data index was rebuilt successfully
Category Products index was rebuilt successfully
Search Index index was rebuilt successfully
Stock Status index was rebuilt successfully
Tag Aggregation Data index was rebuilt successfully
Improved Sorting index was rebuilt successfully
D2 - Search Terms to Category index was rebuilt successfully
D2 - Search Terms to Attributes index was rebuilt successfully

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 82 bytes) in /public_html/lib/Zend/Db/Adapter/Abstract.php on line 545

Can anyone please suggest me how much memory to allocate for such volume of store?

  • Have you installed some extensions hooking into indexing process? I'm maintaing some store with +50k products and the index process has no problem with the available memory of 500M. So I believe an extension could cause the lack
    – bukart
    Jun 28, 2014 at 10:10
  • are you using Magento EE or CE?
    – Alex Dinca
    Jun 28, 2014 at 10:43
  • Magento CE Version Jun 28, 2014 at 11:23
  • When you are running 10s thousands of products you should be generating $100s thousands revenues, which should have hosting at 0.5-1% of revenue. The simple answer is you are trying to do too much with too little (the normal approach with Magento). It depends on number of stores, categories, tier prices, etc. We have run stores will 100s thousands of products so likely your complete underlying architecture is not up to the job - not just a php problem.
    – user2935
    Jun 28, 2014 at 12:33

4 Answers 4


Your error is only talking about 256MB not the 2G you are talking about. Just we are talking about the same thing - and not raising the memory_limit just failed.

Beside this, you installed some extensions which kill the indexing. I suggest you check the extension which makes the problems. As buk already said, normal magento runs fine with 256M.

  • ohh .. m sorry, you are correct its not 2GB its 256 MB .. thanks for correcting me. Jun 28, 2014 at 11:23
  • 15k product and 30k customers, currently need 512M to not start throwing memory errors. Jun 28, 2014 at 21:21

If you have a host, contact them. There are a few variables to this issue.

I had a very similar issue and ultimately found that my server was running php-fpm which meant that there was a cap on how much memory you could allocate. Didn't matter if I used ini_set, htaccess, or even php.ini. I'm not sure how, but the host was able to configure php to raise the cap.

Good luck


You're probably mixing up VPS memory amount and PHP memory limit. Your PHP memory limit is 256MB which nowadays is considered absolute rock bottom for Magento. I know many people who consider 512MB new minimum and I've seen stores that have memory limit of 2GB.

Optimal memory limit depends on many things and there's no silver bullet amount (except that more is always better). Factors that influence it are for example number of products, number of store views, number of customer groups, currencies, quality of code, extensions and so on and so forth.


When running scripts from the command line, you are using a different PHP interpreter than that used by php applications running on the web server.

Your PHP cli interpreter also uses a different configuration file.

You must set the memory_limit in that file for command line scripts as it does not use the memory_limit in your .htaccess file

268,435,456 bytes indicates that cli memory_limit is currently set at 256M

If you're not running a recommended dedicated or VPS system that allows you to configure your server properly, then you will need to get in touch with your hosting provider to get this taken care of.

If they tell you it's not possible, then they are not a hosting provider that supports Magento and you need to start looking for a hosting provider that supports Magento and gives it the resources it needs to run.

Not the answer you're looking for? Browse other questions tagged or ask your own question.