Bug #53598

Epic #55070: Workpackages

Epic #55065: WP: Overall System Performance (Backend and Frontend)

Bug #52949: Speed decrease since 4.5

Select/Delete fe_sessions twice per request

Added by Alexander Opitz over 8 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Category:
Code Cleanup
Target version:
-
Start date:
2013-11-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Requesting a page results in two validations of the fe_session. Also the ses_id changes (as there is nothing written to the fe_sessions table). So we send out a session cookie for nothing (See #42592).

One request (fully cached page):

"Connect","typo3@localhost on " 
"Query","SET NAMES utf8" 
"Query","SELECT @@SESSION.sql_mode" 
"Init DB","typo3_master" 
"Query","SELECT COUNT(*) FROM fe_sessions WHERE ses_id = 'a384c00da8f25f0e2520431737b2a2ad'" 
"Query","SELECT content,tstamp FROM fe_session_data WHERE hash = 'a384c00da8f25f0e2520431737b2a2ad'" 
"Query","SELECT * FROM fe_sessions,fe_users WHERE fe_sessions.ses_id = '59006c68d372d7bd4746114f7ea7437f'
                    AND fe_sessions.ses_name = 'fe_typo_user'
                    AND fe_sessions.ses_userid = fe_users.uid
                    AND (
                fe_sessions.ses_iplock = '192.168'
                OR fe_sessions.ses_iplock='[DISABLED]'
                )
                    AND fe_sessions.ses_hashlock=218779088
                     AND fe_users.disable=0 AND fe_users.deleted=0 AND (fe_users.starttime<=1384339898) AND (fe_users.endtime=0 OR fe_users.endtime>1384339898)" 
"Query","DELETE FROM fe_sessions WHERE ses_id = '59006c68d372d7bd4746114f7ea7437f'
                        AND ses_name = 'fe_typo_user'" 
"Query","SELECT * FROM fe_sessions,fe_users WHERE fe_sessions.ses_id = '59006c68d372d7bd4746114f7ea7437f'
                    AND fe_sessions.ses_name = 'fe_typo_user'
                    AND fe_sessions.ses_userid = fe_users.uid
                    AND (
                fe_sessions.ses_iplock = '192.168'
                OR fe_sessions.ses_iplock='[DISABLED]'
                )
                    AND fe_sessions.ses_hashlock=218779088
                     AND fe_users.disable=0 AND fe_users.deleted=0 AND (fe_users.starttime<=1384339898) AND (fe_users.endtime=0 OR fe_users.endtime>1384339898)" 
"Query","DELETE FROM fe_sessions WHERE ses_id = '59006c68d372d7bd4746114f7ea7437f'
                        AND ses_name = 'fe_typo_user'" 
"Query","SELECT * FROM fe_session_data WHERE hash = '59006c68d372d7bd4746114f7ea7437f'" 
"Query","SELECT pages.uid,sys_domain.redirectTo,sys_domain.redirectHttpStatusCode,sys_domain.prepend_params FROM pages,sys_domain WHERE pages.uid=sys_domain.pid
                        AND sys_domain.hidden=0
                        AND (sys_domain.domainName='typo3-master.sphinx.lan.pluspol.info' OR sys_domain.domainName='typo3-master.sphinx.lan.pluspol.info/')  AND pages.deleted=0 AND pages.hidden=0 AND pages.starttime<=1384339860 AND (pages.endtime=0 OR pages.endtime>1384339860)  AND NOT pages.t3ver_state>0 AND pages.doktype<200 AND (pages.fe_group='' OR pages.fe_group IS NULL OR pages.fe_group='0' OR FIND_IN_SET('0',pages.fe_group) OR FIND_IN_SET('-1',pages.fe_group)) LIMIT 1" 
"Query","SELECT * FROM pages WHERE pid=0 AND pages.deleted=0 AND pages.hidden=0 AND pages.starttime<=1384339860 AND (pages.endtime=0 OR pages.endtime>1384339860)  AND NOT pages.t3ver_state>0 AND pages.doktype<200 AND (pages.fe_group='' OR pages.fe_group IS NULL OR pages.fe_group='0' OR FIND_IN_SET('0',pages.fe_group) OR FIND_IN_SET('-1',pages.fe_group)) ORDER BY sorting LIMIT 1" 
"Query","SELECT * FROM pages WHERE uid=1 AND pages.deleted=0 AND pages.hidden=0 AND pages.starttime<=1384339860 AND (pages.endtime=0 OR pages.endtime>1384339860)  AND NOT pages.t3ver_state>0 AND pages.doktype<200 AND (pages.fe_group='' OR pages.fe_group IS NULL OR pages.fe_group='0' OR FIND_IN_SET('0',pages.fe_group) OR FIND_IN_SET('-1',pages.fe_group))" 
"Query","SELECT content FROM cf_cache_rootline WHERE identifier = '1__0_0_0' AND cf_cache_rootline.expires >= 1384339898 LIMIT 1" 
"Query","SELECT content FROM cf_cache_pagesection WHERE identifier = '1_222419149' AND cf_cache_pagesection.expires >= 1384339898 LIMIT 1" 
"Query","SELECT content FROM cf_cache_pages WHERE identifier = '7e7cf228cfa0c6c0892caf3f54dccaf7' AND cf_cache_pages.expires >= 1384339898 LIMIT 1" 
"Quit",

Second request (fully cached page):

"Connect","typo3@localhost on " 
"Query","SET NAMES utf8" 
"Query","SELECT @@SESSION.sql_mode" 
"Init DB","typo3_master" 
"Query","SELECT COUNT(*) FROM fe_sessions WHERE ses_id = '59006c68d372d7bd4746114f7ea7437f'" 
"Query","SELECT content,tstamp FROM fe_session_data WHERE hash = '59006c68d372d7bd4746114f7ea7437f'" 
"Query","SELECT * FROM fe_sessions,fe_users WHERE fe_sessions.ses_id = '6415d190c31aa288c97d15d46b540253'
                    AND fe_sessions.ses_name = 'fe_typo_user'
                    AND fe_sessions.ses_userid = fe_users.uid
                    AND (
                fe_sessions.ses_iplock = '192.168'
                OR fe_sessions.ses_iplock='[DISABLED]'
                )
                    AND fe_sessions.ses_hashlock=218779088
                     AND fe_users.disable=0 AND fe_users.deleted=0 AND (fe_users.starttime<=1384340298) AND (fe_users.endtime=0 OR fe_users.endtime>1384340298)" 
"Query","DELETE FROM fe_sessions WHERE ses_id = '6415d190c31aa288c97d15d46b540253'
                        AND ses_name = 'fe_typo_user'" 
"Query","SELECT * FROM fe_sessions,fe_users WHERE fe_sessions.ses_id = '6415d190c31aa288c97d15d46b540253'
                    AND fe_sessions.ses_name = 'fe_typo_user'
                    AND fe_sessions.ses_userid = fe_users.uid
                    AND (
                fe_sessions.ses_iplock = '192.168'
                OR fe_sessions.ses_iplock='[DISABLED]'
                )
                    AND fe_sessions.ses_hashlock=218779088
                     AND fe_users.disable=0 AND fe_users.deleted=0 AND (fe_users.starttime<=1384340298) AND (fe_users.endtime=0 OR fe_users.endtime>1384340298)" 
"Query","DELETE FROM fe_sessions WHERE ses_id = '6415d190c31aa288c97d15d46b540253'
                        AND ses_name = 'fe_typo_user'" 
"Query","SELECT * FROM fe_session_data WHERE hash = '6415d190c31aa288c97d15d46b540253'" 
"Query","SELECT pages.uid,sys_domain.redirectTo,sys_domain.redirectHttpStatusCode,sys_domain.prepend_params FROM pages,sys_domain WHERE pages.uid=sys_domain.pid
                        AND sys_domain.hidden=0
                        AND (sys_domain.domainName='typo3-master.sphinx.lan.pluspol.info' OR sys_domain.domainName='typo3-master.sphinx.lan.pluspol.info/')  AND pages.deleted=0 AND pages.hidden=0 AND pages.starttime<=1384340280 AND (pages.endtime=0 OR pages.endtime>1384340280)  AND NOT pages.t3ver_state>0 AND pages.doktype<200 AND (pages.fe_group='' OR pages.fe_group IS NULL OR pages.fe_group='0' OR FIND_IN_SET('0',pages.fe_group) OR FIND_IN_SET('-1',pages.fe_group)) LIMIT 1" 
"Query","SELECT * FROM pages WHERE pid=0 AND pages.deleted=0 AND pages.hidden=0 AND pages.starttime<=1384340280 AND (pages.endtime=0 OR pages.endtime>1384340280)  AND NOT pages.t3ver_state>0 AND pages.doktype<200 AND (pages.fe_group='' OR pages.fe_group IS NULL OR pages.fe_group='0' OR FIND_IN_SET('0',pages.fe_group) OR FIND_IN_SET('-1',pages.fe_group)) ORDER BY sorting LIMIT 1" 
"Query","SELECT * FROM pages WHERE uid=1 AND pages.deleted=0 AND pages.hidden=0 AND pages.starttime<=1384340280 AND (pages.endtime=0 OR pages.endtime>1384340280)  AND NOT pages.t3ver_state>0 AND pages.doktype<200 AND (pages.fe_group='' OR pages.fe_group IS NULL OR pages.fe_group='0' OR FIND_IN_SET('0',pages.fe_group) OR FIND_IN_SET('-1',pages.fe_group))" 
"Query","SELECT content FROM cf_cache_rootline WHERE identifier = '1__0_0_0' AND cf_cache_rootline.expires >= 1384340298 LIMIT 1" 
"Query","SELECT content FROM cf_cache_pagesection WHERE identifier = '1_222419149' AND cf_cache_pagesection.expires >= 1384340298 LIMIT 1" 
"Query","SELECT content FROM cf_cache_pages WHERE identifier = '7e7cf228cfa0c6c0892caf3f54dccaf7' AND cf_cache_pages.expires >= 1384340298 LIMIT 1" 
"Quit",


Related issues

Related to TYPO3 Core - Feature #42592: FE sessions (cookies) should only be created when neededClosed2012-11-01

Actions
Related to TYPO3 Core - Bug #16302: alt_doc.php does BE session verification twiceClosed2006-06-28

Actions
Related to TYPO3 Core - Feature #51731: Store sessions outside DBClosed2013-09-04

Actions
Related to TYPO3 Core - Bug #34964: FE Session record is never removed, even if no session data leftClosed2012-03-17

Actions
Related to TYPO3 Core - Bug #56348: Session randomly lost in eIDClosedMathias Schreiber2014-02-26

Actions
Related to TYPO3 Core - Bug #57751: Felogin session not setClosedMarkus Klein2014-04-08

Actions

Also available in: Atom PDF