Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Magento 2.1.6] Page Cache make growing size more and more #9458

Closed
jurpro opened this issue Apr 30, 2017 · 16 comments
Closed

[Magento 2.1.6] Page Cache make growing size more and more #9458

jurpro opened this issue Apr 30, 2017 · 16 comments
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed non-issue

Comments

@jurpro
Copy link

jurpro commented Apr 30, 2017

Hello. I have a problem with cache on Magento 2.1.x
Accourding my hosting provider services, the script of Magento 2.1.x more bigger and bigger size day by day. For example, last week the size of all files and folders is 400 MB, 2 days later 500 MB, and now 2 GB, and may be in a month it size approximately 32 GB.

This is problem for me when I need to upgrade to the latest version of Magento 2.1.x or the latest version theme, I need to backup all files but the system is very slow.

Preconditions

Make a backup files for Magento system

Steps to reproduce

  1. Open Cpanel, then Files Explorer
  2. Make a backup file for Magento system such as ZIP files.

Expected result

  1. The backup file successful such as magento.zip

Actual result

  1. Long time for result zip files.
  2. Or If unsuccesful there is only file with something like this: zzYYhMmB, xxTgBhM

According to my hosting service support, there is a bigger files on : /home/xxxxx/public_html/var/page_cache day by day.

I wish, next version, Magento can fix this problem.

Here is the answer from my Hosting:

Hi there,

In my last reply I showed where most the data was used which is here:

And in /home/xxxx/public_html/var/page_cache

There is 16G used:

978M ./mage--5
984M ./mage--7
993M ./mage--9
1001M ./mage--b
979M ./mage--8
985M ./mage--f
983M ./mage--1
1000M ./mage--a
982M ./mage--2
992M ./mage--6
994M ./mage--3
1004M ./mage--e
1000M ./mage--4
1019M ./mage--0
987M ./mage--d
981M ./mage--c
90M ./mage-tags
16G .

Note these are page cache files and can be deleted, it seems your script does not clean up cache files and the size of the folder is growing constantly.

@choukalos
Copy link

What specific version of Magento are you on?

How many Sku's do you have on your store? #Sku's will drive page cache and block cache growth.

It's possible images being resized are also probably increasing storage space - when you import product photos we don't re-size the images until the store takes traffic. Your store is getting traffic and triggering the image resizes. You'll have a # of image resizes based on the # of different images your theme uses.

Have you tried flushing your cache? That should clean up the cache files from var/. You'd want to do that after you upgraded anyway so there's no harm in doing it before to reduce your backup time.

@korostii
Copy link
Contributor

korostii commented May 4, 2017

Note these are page cache files and can be deleted, it seems your script does not clean up cache files and the size of the folder is growing constantly.

So, have you tried doing that? It's completely safe to delete everything under var if you need storage space.

Besides, when you do that backup of yours, it might be a good idea to skip the var and pub\media\catalog\product\cache\ folders from the archive.

@jurpro
Copy link
Author

jurpro commented May 4, 2017

Magento version 2.1.6 but I had this problem since 2.1.4 and 2.1.5

Hi @choukalos and @korostii thank you for your advice. Today I tried what you ask me. I do flush chace storage. I never do that, because if I click that button, there is a warning "The cache storage may contain additional data. Are you sure that you want to flush it?" So, I never do that.

Thank you so much. Now, it on light capacity.

My suggest, how if the warning for the flush cache storage is add with something like this, "this flush can reduce storage capacity from bla bla bla bla..." just like that. So, everyone will doing it to make more space on their disk sever.

Thank you again

@magento-engcom-team magento-engcom-team added G1 Passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@magento-engcom-team
Copy link
Contributor

@jurpro, thank you for your report.
This seems to be correct Magento behavior. Please refer to the Community Forums or the Magento Stack Exchange site for advice or general discussion about this.
Otherwise you may submit Pull Request with the suggested changes.

@nplinhho
Copy link

I have the same issue on Magento 2.3.0

My store includes about 8000 products,
it always increases about 10GB each week, and have to flush them at the end of week.

@hostep
Copy link
Contributor

hostep commented Jul 24, 2019

If you use file based caching, then yes, the full page cache keeps growing and growing until you manually flush it. Magento currently has no mechanism to keep it under control. You could try switching to Varnish as an alternative?
Also see: #16375 (comment)

@nplinhho
Copy link

If you use file based caching, then yes, the full page cache keeps growing and growing until you manually flush it. Magento currently has no mechanism to keep it under control. You could try switching to Varnish as an alternative?
Also see: #16375 (comment)

Because our hosting provider doesn't support Varnish.
BTW, Varnish sometime has issue and not stable on data response. So it is not my solution for FPC.

@hostep
Copy link
Contributor

hostep commented Jul 24, 2019

Ok, then you could ask the hosting for more disk space so you don't need to flush it so often. Or just keep doing what you are doing and flushing the page cache every week. If that works for you then you currently have a solution for the problem 👍

@MagePsycho
Copy link
Contributor

Just wondering why it keeps on increasing the disk space. Even if it increases it should increase to a few MBs, not in GBs. Is there a better way to manage var/page-cache/ in hosting with limited space?

@opentechiz
Copy link

Just wondering why it keeps on increasing the disk space. Even if it increases it should increase to a few MBs, not in GBs. Is there a better way to manage var/page-cache/ in hosting with limited space?

I think it is because layered navigation pages which are discovered more time to time

@drinkingsouls
Copy link

drinkingsouls commented Dec 14, 2020

Magento 2.4x, my store is 8000+ product. Magento 2 cache fills server every week, 30GB+ cache. Did anyone have any solutions to this?

@AddoSolutions
Copy link

AddoSolutions commented Dec 14, 2020

Same issue here, we have a relatively small catalog (~2500) and just had to clear var/page_cache which was over 52GB. This seems like a memory-leak for HDDs, possibly a DDoS attack? @magento-engcom-team This is not expected behavior

@amitvkhajanchi
Copy link

I have same issue. I just migrated from Magento 2.3.3 -> 2.4.1 this week and configured Varnish. I have about 5000 products on catalog and have 6 store views (US, FR, UK, DE, IT, ES) etc. I had to put in a cron to flush my cache every 2 hours... as it was growing to 100GB (magento2/var/cache). I disabled FPC in app/etc/env.php but cache seems to be still growing at alarmingly quick speed....

I am using Ubuntu 20.04 LTS
PHP 7.4
Nginx 1.8
Elasticsearch 6.5
Redis 5

Any suggestions?

@korostii
Copy link
Contributor

korostii commented Feb 2, 2022

FYI anyone whom this may concern: this "non-issue" is supposedly being fixed in 2.4.4, at least according to the beta's releases notes. Would be nice to see a pull request or some commits linked in case anyone would like to backport this change to older versions....

@amcguireweb
Copy link

FYI anyone whom this may concern: this "non-issue" is supposedly being fixed in 2.4.4, at least according to the beta's releases notes. Would be nice to see a pull request or some commits linked in case anyone would like to backport this change to older versions....

Is there anywhere we can see what was changed to fix this issue? We'd like to backport it.

@JMLucas96
Copy link

Same issue @amcguireweb you finde where we can see what was changed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed non-issue
Projects
None yet
Development

No branches or pull requests