0

Got warning from server regarding Disk space getting full.

After checking into file manager I found 17.2 GB of file size in session folder.

When looked into var/session folder, I can see unusual size ranging from 400 MB to 2.5 GB and years of these files as 2031, 1987, 1970, 1990.

Is it normal to have session files with size 2GB and greater?

Even unable to delete these unusual session files (Response: 550 Could not delete sess_2fjtnha6k4be02r2p1ofdh1qt4: Invalid argument)

Any suggestions?

Wasiq Shahrukh
  • 592
  • 1
  • 6
  • 32
  • @MagenX : No it doesn't answer my question, the code will not delete the files which have their date as from future. please read questions carefully before marking them duplicate. – Wasiq Shahrukh Nov 10 '17 at 08:58
  • 1
    Just come across one of our client's M1 session folder of 90Gb !! – zigojacko Feb 05 '21 at 16:31

1 Answers1

1

Clear it once or twice a day just to be safe

Don't. Unless you intentionally want to disrupt sales by obliterating customer carts.

I put sessions in RAM

Don't. This is a common (and dangerous) Magento myth.

  • If its a single-sever deployment, use files and don't look back.
  • If its multi-server, use Redis.

Memcache should not be considered unless either you care not for persistence, or you are hitting the single threaded behaviour of Redis (very unlikely).

Traffic is around 2k-5k

Session files are often ~5kB, if you are using 256,000kB, then that's around 50k per user, something isn't right.

I wouldn't be largely concerned about session storage utilisation, if its consuming space, so be it. I'd only be worried when you start seeing >2GB utilisation and it becomes a performance bottleneck.

Is there a way to check this

Open one of the largest session files in a text editor and you'll find the cause. It will be a rogue 3rd party extension storing information in sessions that perhaps shouldn't be.