Good day. There are 2 domains (2 projects). One performs the authorization function, the second working site. My steps: 1. Authorization on the auth.domain.ru domain 2. Use of the domain.ru domain 3. Each subsequent loading of any page of domain.ru slows down the work of the database with the session table so that the loading of the page becomes simply impossible.
Those. I am authorized to open the site domain.ru. It's ok. Reboot, reboot, reboot. Loading is already slower. If you restart 10 again, the download is no longer running.
And viewing the data in the session table also becomes sad. The window hangs, then it is still loaded, but it does not show the data of the column with the jsonb type. The postgresql database.
After a long wait for the page to load, the download stops and the node.js application gives an error
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Please tell me how to solve the problem.
Session code:
app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); app.use(session({ store: new pgSession({ pg : pg, // Use global pg-module conString : 'http://postgres:mydatabase@127.0.0.1:5432/data', // Connect using something else than default DATABASE_URL env variable tableName : 'session' // Use another table-name than the default "session" one }), secret: 'mysecret', cookie: { maxAge: 30 * 24 * 60 * 60 * 1000, domain: 'domain.ru' }, resave: false, saveUninitialized: true, secure: true })); app.use(passport.initialize()); app.use(passport.session()); app.use(cookieParser());