*

mwindey

  • *****
  • 485 posts
Tremendous amount of inodes on hosting created by sessions osclass
« on: September 01, 2022, 04:32:38 PM »
My hosting package was running full because of the amount of inodes that where created and left in /.cagefs/opt/alt/php80/var/lib/php/session
I asked my host what was wrong and they told me it is probably session that are opened but never get closed by the script.
What i have done is delete all files from server and reinstalled original osclass with latest epsilon and no plugins.... It takes 5 minutes and sessions are getting created and left open so the folder has 5000000 inodes after a few days....
Anyone else with this issue?

*

Brandso

  • ****
  • 108 posts
Re: Tremendous amount of inodes on hosting created by sessions osclass
« Reply #1 on: September 01, 2022, 06:04:24 PM »
Hi,

I had this cagefs error few days ago when I had configured cron on my server. Then with help of hosting provider I removed that cron setup as it was utilising 100% cpu usage due to which my site access was blocked with error 503. Maybe your cron setup is creating this problem just like mine.

Thanks

*

mwindey

  • *****
  • 485 posts
Re: Tremendous amount of inodes on hosting created by sessions osclass
« Reply #2 on: September 01, 2022, 07:21:41 PM »
@Brandso,

Thanks for fast reply.... I will try it out and let you know....Hope it works because this is really f*c*ed :-)

*

Tango

  • ****
  • 214 posts
Re: Tremendous amount of inodes on hosting created by sessions osclass
« Reply #3 on: September 01, 2022, 08:24:46 PM »
Did you try with only the script installed, and no themes?

Just to narrow down the possible source of the issue.

*

mwindey

  • *****
  • 485 posts
Re: Tremendous amount of inodes on hosting created by sessions osclass
« Reply #4 on: September 02, 2022, 11:19:48 AM »
@Tango

Fresh install without cron and plugins and use of original sigma theme generates 66 files in 5 seconds.
All 41 bytes including the txt:     messages|a:0:{}keepForm|a:0:{}form|a:0:{}

*

Tango

  • ****
  • 214 posts
Re: Tremendous amount of inodes on hosting created by sessions osclass
« Reply #5 on: September 02, 2022, 01:37:03 PM »
Out of curiosity, do you happen to have MemCache enabled in config.php?
Code: [Select]
MemCache caching option (database queries cache)
define('OSC_CACHE', 'memcache');
$_cache_config[] = array('default_host' => 'localhost', 'default_port' => 11211, 'default_weight' => 1);


Also, I think the issue is indeed related to sessions:
https://github.com/osclass/Osclass/issues/1798#issuecomment-71290085
« Last Edit: September 02, 2022, 01:39:55 PM by Tango »

*

MB Themes

Re: Tremendous amount of inodes on hosting created by sessions osclass
« Reply #6 on: September 02, 2022, 01:46:08 PM »
@Tango
I use memcache and never had issue with that.

Code: [Select]
define('OSC_CACHE', 'memcache');
$_cache_config[] = array('default_host' => '127.0.0.1', 'default_port' => 11211, 'default_weight' => 1);
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Tango

  • ****
  • 214 posts
Re: Tremendous amount of inodes on hosting created by sessions osclass
« Reply #7 on: September 02, 2022, 01:58:38 PM »
Then it's a weird one, as most sessions are cleared properly with:
Code: [Select]
Session::newInstance()->_dropKeepForm();
Session::newInstance()->_dropForm();

Something must be getting left out...

@mwindey as a last resort, I would also try with a vanilla Osclass 3.8.0, just to eliminate the possibility of an old core issue, and not one introduced by v8+.

*

mwindey

  • *****
  • 485 posts
Re: Tremendous amount of inodes on hosting created by sessions osclass
« Reply #8 on: September 02, 2022, 02:18:33 PM »
@tango

i was using memcache but on a fresh install this was disabled in config file so that is not the point.
All started recently (about 14days ago) and at first i thought it was the epsilon but that is not the problem because fresh install with sigma does it also.

I will try later to go back in time with previous versions from osclass.....
Another question: Where is this located?
Code: [Select]
Session::newInstance()->_dropKeepForm();
Session::newInstance()->_dropForm();

Thanks

*

MB Themes

Re: Tremendous amount of inodes on hosting created by sessions osclass
« Reply #9 on: September 02, 2022, 02:27:29 PM »
@mwindey
These codes will use existing session.


Btw. few months ago we have also issue with sessions - they expired within several seconds/minutes together with cookies. After spending hours and hours, we asked hosting to move on different server and problem disappeared. Even hosting tech guys were not able to identify what was issue.


I strongly recommend to play with oc-includes/osclass/core/Session.php
Code: [Select]
  public static function newInstance()
  {
    if (!self::$instance instanceof self) {
      self::$instance = new self;
    }
    return self::$instance;
  }

  public function session_start()
  {
    $currentCookieParams = session_get_cookie_params();
    if (defined('COOKIE_DOMAIN')) {
      $currentCookieParams[ 'domain' ] = COOKIE_DOMAIN;
    }
    if ( isset($_SERVER['HTTPS']) ) {
      $currentCookieParams["secure"] = true;
    }
    session_set_cookie_params(
      $currentCookieParams[ 'lifetime' ],
      $currentCookieParams[ 'path' ],
      $currentCookieParams[ 'domain' ],
      $currentCookieParams[ 'secure' ],
      true
    );

    if (!isset($_SESSION)) {
      session_name('osclass');
      if (!$this->_session_start()) {
        session_id(uniqid('', true));
        session_start();
        session_regenerate_id();
      }
    }

    $this->session = $_SESSION;
    if ($this->_get('messages') == '') {
      $this->_set('messages', array());
    }
    if ($this->_get('keepForm') == '') {
      $this->_set('keepForm', array());
    }
    if ($this->_get('form') == '') {
      $this->_set('form', array());
    }
  }

This is only place where osclass should be able to create session.
Code: [Select]
        session_id(uniqid('', true));
        session_start();
        session_regenerate_id();
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mwindey

  • *****
  • 485 posts
Re: Tremendous amount of inodes on hosting created by sessions osclass
« Reply #10 on: September 02, 2022, 05:38:06 PM »
@MB Themes

Appreciate the answer and i will try to look into session file... Meanwhile i am also transferring site to another server so i will have to wait for dns to point to my new ip.

Will keep you guys informed....
Thanks all and enjoy the  weekend  :P :P :P :P :)