HTML markup is stored in session
Hello!
I`ve faced a problem, that large amount of HTML markup is stored in sessions table on UPDATE, so it cause a terrific performance issue.
Markup is written at the end of serialized session array. We got memcache installed also. Google says nothing, except some strange topics about invite module slowing down the site.
Bin log is full of rows like this:
/*Some User : sess_write */ UPDATE sessions SET uid = 75715, cache = 0, hostname = 'some_host_name', session = 'image_captcha|a:6:{i:521834116;s:4:\"e1sk\";i:1186741668;s:4:\"6aw2\";i:1084518340;s:4:\"kv25\";i:455724407;s:4:\"jxxj\";i:625258243;s:4:\"mm71\";i:1338914899;s:4:\"9tkp\";}captcha|a:2:{s:13:\"user_register\";a:3:{s:7:\"success\";b:1;s:32:\"cad2b3f80cb09e37920639ed516051eb\";s:4:\"6aw2\";s:32:\"e3ffee5d3f3e73c574e546e9d50f2848\";s:4:\"kv25\";}s:7:\"success\";b:1;}cache_flush|a:2:{s:11:\"cache_block\";i:1254231115;s:10:\"cache_page\";i:1254231115;}og_last|O:8:\"stdClass\":51:{s:3:\"nid\";s:5:\"25878\";s:4:\"type\";s:5:\"panel\";s:8:\"language\";s:2:\"ru\";s:3:\"uid\";s:4:\"3584\";s:6:\"status\";s:1:\"1\";s:7:\"created\";s:10:\"1237287565\";s:7:\"changed\";s:10:\"1241105428\";s:7:\"comment\";s:1:\"0\";s:7:\"promote\";s:1:\"0\";s:8:\"moderate\";s:1:\"0\";s:6:\"sticky\";s:1:\"0\";s:4:\"tnid\";s:1:\"0\";s:9:\"translate\";s:1:\"0\";s:3:\"vid\";s:5:\"40379\";s:12:\"revision_uid\";s:4:\"3341\";s:5:\"title\";s:84:\"From this topic\";s:4:\"body\";s:21791:\"
... LOTS OF MARKUP... looks like whole page is stored ....
\"\";s:3:\"log\";s:0:\"\";s:18:\"revision_timestamp\";s:10:\"1241105428\";s:6:\"format\";s:1:\"1\";s:4:\"name\";s:27:\"Anny Hall\";s:7:\"picture\";s:45:\"sites/default/files/pictures/picture-3584.jpg\";s:4:\"data\";s:1563:\"a:21:{s:7:\"display\";s:1:\"0\";s:10:\"og_reg_key\";s:0:\"\";s:12:\"current_date\";s:10:\"1220528634\";s:10:\"current_id\";s:1:\"2\";s:13:\"form_build_id\";s:37:\"form-d6256db93b610ec83cd03a3107eb7341\";s:16:\"captcha_response\";s:8:\"хтеб\";s:16:\"captcha_solution\";s:8:\"some text\";s:13:\"captcha_token\";s:32:\"4a9a1a19d7f2ddea5d44533ae389e846\";s:12:\"captcha_info\";a:4:{s:7:\"form_id\";s:13:\"user_register\";s:10:\"preprocess\";b:0;s:6:\"module\";s:13:\"image_captcha\";s:4:\"type\";s:5:\"Image\";}s:18:\"birthdays_starsign\";s:6:\"gemini\";s:7:\"contact\";i:1;s:14:\"picture_delete\";i:0;s:14:\"picture_upload\";s:0:\"\";s:34:\"user_relationship_mailer_send_mail\";i:1;s:16:\"guestbook_status\";s:1:\"0\";s:20:\"guestbook_send_email\";i:0;s:15:\"guestbook_intro\";s:0:\"\";s:17:\"messaging_default\";s:4:\"mail\";s:27:\"notifications_send_interval\";s:2:\"-1\";s:18:\"notifications_auto\";i:0;s:5:\"block\";a:12:{s:5:\"block\";a:1:{i:27;i:1;}s:5:\"views\";a:7:{s:17:\"my_groups-block_1\";i:1;s:18:\"groups_new-block_1\";i:1;s:24:\"og_members_block-block_1\";i:1;s:21:\"blog_comments-block_1\";i:1;s:21:\"more_comments-block_1\";i:1;s:21:\"last_comments-block_1\";i:1;s:18:\"og_banners-block_1\";i:1;}s:7:\"archive\";a:1:{i:0;i:1;}s:4:\"user\";a:1:{i:3;i:1;}s:7:\"counter\";a:1:{i:0;i:1;}s:9:\"birthdays\";a:1:{s:12:\"by_birthdays\";i:1;}s:10:\"userpoints\";a:1:{i:0;i:1;}s:8:\"drupalit\";a:3:{i:2;i:1;i:3;i:1;i:4;i:1;}s:10:\"statistics\";a:1:{i:0;i:1;}s:16:\"relevant_content\";a:2:{s:7:\"default\";i:1;s:6:\"groups\";i:1;}s:24:\"user_relationship_blocks\";a:4:{s:4:\"my-1\";i:1;s:4:\"my-2\";i:1;s:16:\"my-3-you_to_them\";i:1;s:16:\"my-3-them_to_you\";i:1;}s:4:\"book\";a:1:{i:0;i:1;}}}\";s:11:\"panels_node\";a:3:{s:3:\"nid\";s:5:\"25878\";s:6:\"css_id\";s:0:\"\";s:3:\"did\";s:5:\"31786\";}s:16:\"field_metod_help\";a:1:{i:0;a:1:{s:5:\"value\";s:1:\"0\";}}s:13:\"field_og_type\";a:1:{i:0;a:1:{s:5:\"value\";s:62:\"some text\";}}s:11:\"field_level\";a:3:{i:0;a:1:{s:5:\"value\";s:52:\"some topic\";}i:1;a:1:{s:5:\"value\";s:50:\"some topic\";}i:2;a:1:{s:5:\"value\";s:63:\"some topic\";}}s:13:\"field_subject\";a:1:{i:0;a:1:{s:5:\"value\";s:23:\"All subjects\";}}s:15:\"field_auditoria\";a:2:{i:0;a:1:{s:5:\"value\";s:16:\"Some role\";}i:1;a:1:{s:5:\"value\";s:43:\"Another role\";}}s:15:\"field_territory\";a:1:{i:0;a:1:{s:5:\"value\";s:97:\"Some group\";}}s:16:\"field_og_archive\";a:1:{i:0;a:1:{s:5:\"value\";s:1:\"0\";}}s:12:\"og_selective\";s:1:\"0\";s:14:\"og_description\";s:276:\"Some add\";s:8:\"og_theme\";N;s:11:\"og_register\";s:1:\"0\";s:12:\"og_directory\";s:1:\"1\";s:12:\"notification\";s:1:\"0\";s:11:\"og_language\";s:0:\"\";s:10:\"og_private\";s:1:\"0\";s:4:\"path\";s:17:\"communities/25878\";s:22:\"last_comment_timestamp\";s:10:\"1237287565\";s:17:\"last_comment_name\";N;s:13:\"comment_count\";s:1:\"0\";s:17:\"epublish_abstract\";N;s:6:\"photos\";a:1:{s:5:\"count\";i:0;}s:8:\"taxonomy\";a:3:{i:34912;O:8:\"stdClass\":5:{s:3:\"tid\";s:5:\"34912\";s:3:\"vid\";s:2:\"16\";s:4:\"name\";s:49:\"some text\";s:11:\"description\";s:0:\"\";s:6:\"weight\";s:1:\"0\";}i:34913;O:8:\"stdClass\":5:{s:3:\"tid\";s:5:\"34913\";s:3:\"vid\";s:2:\"16\";s:4:\"name\";s:20:\"some text\";s:11:\"description\";s:0:\"\";s:6:\"weight\";s:1:\"0\";}i:28545;O:8:\"stdClass\":5:{s:3:\"tid\";s:5:\"28545\";s:3:\"vid\";s:2:\"16\";s:4:\"name\";s:33:\"some text\";s:11:\"description\";s:0:\"\";s:6:\"weight\";s:1:\"0\";}}s:5:\"files\";a:1:{i:16325;O:8:\"stdClass\":13:{s:3:\"fid\";s:5:\"16325\";s:3:\"uid\";s:4:\"3584\";s:8:\"filename\";s:68:\"some text..ppt\";s:8:\"filepath\";s:88:\"sites/default/files/some text..ppt\";s:8:\"filemime\";s:29:\"application/vnd.ms-powerpoint\";s:8:\"filesize\";s:7:\"6012928\";s:6:\"status\";s:1:\"1\";s:9:\"timestamp\";s:10:\"1238425695\";s:3:\"nid\";s:5:\"25878\";s:3:\"vid\";s:5:\"40379\";s:11:\"description\";s:68:\"some text..ppt\";s:4:\"list\";s:1:\"1\";s:6:\"weight\";s:2:\"-1\";}}s:8:\"homepage\";N;s:8:\"realname\";s:46:\"some text\";s:5:\"roles\";a:2:{i:12;s:39:\"some text\";i:14;s:31:\"some text\";}}og_user_role|s:5:\"25878\";', timestamp = 1254231453 WHERE sid = '1541d3as63aa46b3716233136892asd864c85132'
It is also wierd that such amount of parameters are stored.
Any help will be highly appreciated.
Thanks.

You have it backwards
Storing the serialized data in the sessions table avoids the overhead of having to reconstruct the data through potentially hundreds of database queries. It enhances performance by reducing queries; it doesn't hurt performance.
If your database is slow, you could consider moving the sessions table into memory at the MySQL level, or switch to using Memcached for sessions.
In my case it is a problem,
In my case it is a problem, cause bin logs are used for replication of database - so HDDs are killed with write operations.
But switching to Memcache`s session.inc is a good idea, I`ll try to do it - thanks!