(tens of) thousands php sessions files in virtual host tmp dir

Discussion in 'General' started by StrikerNL, Mar 5, 2009.

  1. StrikerNL

    StrikerNL New Member

    I noticed the tmp dir in one of my virtual hosts growing rather large, so I checked it out and I saw something like this:

    I think I probably missed a setting or something because session files don't seem to get removed. There were literally tens of thousands, 90 mb's worth! What can I do to fix this?

    Code:
    7d6b045
    -rw-------  1 www-data www-data        0 2009-02-18 14:09 sess_d68b8843cd6d28155c34f126b5c59585
    -rw-------  1 www-data www-data        0 2009-02-21 06:07 sess_d68b8dbe788ac34bf0c8f2f1330136fd
    -rw-------  1 www-data www-data        0 2009-02-26 05:14 sess_d68baf598f5d9fc15541bc4d6af870bb
    -rw-------  1 www-data www-data        0 2009-02-25 23:24 sess_d68bcacdac3702d1220f615d8303af55
    -rw-------  1 www-data www-data        0 2009-02-23 01:28 sess_d68bf7502ef849c3a9064c8ea9694b54
    -rw-------  1 www-data www-data        0 2009-03-02 09:57 sess_d68c19d2d31c057100f0c15f53e7f672
    -rw-------  1 www-data www-data        0 2009-02-18 22:20 sess_d68c4f6455d792e5b50d6f4600754364
    -rw-------  1 www-data www-data        0 2009-02-15 05:21 sess_d68ca4892edab3e51524f16b81ae431a
    -rw-------  1 www-data www-data        0 2009-02-28 19:55 sess_d68cc06ff800f73529590723d51c548e
    -rw-------  1 www-data www-data        0 2009-03-02 21:46 sess_d68d7d5d99409448b212fc0db81785fb
    -rw-------  1 www-data www-data        0 2009-03-03 19:59 sess_d68da3c3bffe940262afccb5ea0501a5
    -rw-------  1 www-data www-data        0 2009-02-14 15:03 sess_d68dac929ea9947109bae50ac3558128
    -rw-------  1 www-data www-data        0 2009-03-02 16:56 sess_d68dd94b913bdb02ec15ac02af50d2e6
    -rw-------  1 www-data www-data        0 2009-03-02 18:13 sess_d68e7fa4587d33e292bf0aa8e27d4c7e
    -rw-------  1 www-data www-data        0 2009-02-27 10:23 sess_d68e9d403c021bf02d3e666b8c38fe1e
    -rw-------  1 www-data www-data        0 2009-03-04 09:06 sess_d68ee70379ce533cfdb296d29c9b7929
    -rw-------  1 www-data www-data        0 2009-02-17 13:16 sess_d68ef013f6748e907a20489722933310
    -rw-------  1 www-data www-data        0 2009-02-21 01:14 sess_d68f2ed7fef6032abcba984b2180b3fd
    -rw-------  1 www-data www-data        0 2009-02-20 17:48 sess_d68f373904d07e0ecc51a0603c753f1a
    -rw-------  1 www-data www-data        0 2009-03-03 20:49 sess_d68f4cc47e8499679e33a91da365a4f1
    -rw-------  1 www-data www-data        0 2009-03-04 15:27 sess_d68f6d3feb974ba3e4d86d0cfa353c3b
    -rw-------  1 www-data www-data        0 2009-02-19 07:07 sess_d68f9c1fb22181f4f1752220c3cc7b5a
    -rw-------  1 www-data www-data        0 2009-02-23 17:06 sess_d690013587b7707e3512819ddb2745f3
    -rw-------  1 www-data www-data        0 2009-02-25 22:35 sess_d6901b0becf4d192dd1540336ae4683f
    -rw-------  1 www-data www-data        0 2009-03-05 00:06 sess_d6904a85b7f7def5992915ada6e26391
    -rw-------  1 www-data www-data        0 2009-03-01 22:05 sess_d6909650081fd2e0eab1fd81ede73f90
    -rw-------  1 www-data www-data        0 2009-03-04 08:42 sess_d690ca9ec460ef94912e8c5a669bc725
    -rw-------  1 www-data www-data        0 2009-02-20 13:39 sess_d6919b84e1053e0a018857a5e161327c
    -rw-------  1 www-data www-data        0 2009-03-03 04:45 sess_d691bfc30cb011baac76e949eab01367
    -rw-------  1 www-data www-data        0 2009-02-15 16:13 sess_d6921dd97519c86b1f8c778bfe09732a
    -rw-------  1 www-data www-data        0 2009-02-27 09:22 sess_d69243782ad8756a2c3f10967f614530
    -rw-------  1 www-data www-data        0 2009-02-20 17:18 sess_d692c00640a60d810ff95400ff852f09
    -rw-------  1 www-data www-data        0 2009-03-01 11:03 sess_d692c1e807439588f2a3d410c4b677d7
    -rw-------  1 www-data www-data        0 2009-02-18 09:04 sess_d6937127737537eb0f9f817359df7f1e
    -rw-------  1 www-data www-data        0 2009-02-24 12:09 sess_d693d9bba5ccfb7c2656e77ad3631e7b
    -rw-------  1 www-data www-data        0 2009-02-17 19:24 sess_d693eb72241d453e572572c1f1ff78a9
    -rw-------  1 www-data www-data        0 2009-02-22 06:43 sess_d693ecbef93678c0f2436176be78b1a4
    -rw-------  1 www-data www-data        0 2009-02-16 23:11 sess_d693f5eef1bf1b35f53d9b6f82c30da2
    -rw-------  1 www-data www-data        0 2009-02-25 21:52 sess_d69524944f91b984c49fc1c5bac89490
    -rw-------  1 www-data www-data        0 2009-02-20 19:27 sess_d69592708625072dfe7ad3e41de3096f
    -rw-------  1 www-data www-data        0 2009-03-01 22:42 sess_d6959c09ba8cb75e1fcf906a9ba46394
    -rw-------  1 www-data www-data        0 2009-02-28 02:21 sess_d69622caf4895d7168085a1a652153ca
    -rw-------  1 www-data www-data        0 2009-02-23 00:45 sess_d69654a7077b3daa4be79a0f1b5184e7
    -rw-------  1 www-data www-data        0 2009-02-15 00:49 sess_d6965feff5decfc7aa2945218bbac934
    -rw-------  1 www-data www-data        0 2009-02-16 05:22 sess_d6968c148ee5ea8e1e17a274439bc45a
    -rw-------  1 www-data www-data        0 2009-03-02 01:37 sess_d696e050e67fef9533a44f4a39a2c220
    -rw-------  1 www-data www-data        0 2009-02-22 10:30 sess_d696e6845a10102b2dd2911ebd
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    These files are created and removed by php automatically. You can take a look in your php.ini file if you disabled there something in the session manafement.
     
  3. StrikerNL

    StrikerNL New Member

    Found out what the problem is, in ubuntu session.gc_probability is disabled or set to 0 by default. More people are probably going to be affected by this. I found this in the /etc/php5/apache2/php.ini file:

    Code:
    ; This is disabled in the Debian packages, due to the strict permissions
    ; on /var/lib/php5.  Instead of setting this here, see the cronjob at
    ; /etc/cron.d/php5, which uses the session.gc_maxlifetime setting below.
    ; php scripts using their own session.save_path should make sure garbage
    ; collection is enabled by setting session.gc_probability
    ;session.gc_probability = 0
    I have set this to 1 now, I hope this fixes it, since ISPconfig sets the session storage path for each virtual host anyway.

    Hope this helps other people as well!
     

Share This Page