Skip to main content

Magento Session Data choose (file system or database )

Filesystem Session storage

Remember that innocuous setting during Magento install that asks you if you want to store your sessions on disk or in the database? Well if you are like me, you normally choose filesystem, not knowing any better and having never bothered to test or research the consequences (until now)

The benefits of file-based sessions for Magento are simplicity, stability and durability. It's simple because you don't have to do anything to set it up. It's stable because most modern filesystems use journaling to make sure that in the event of a system crash your session data is consistent. It's also durable, because a system restart will not cause you to lose your session data. Coming back to a webstore a week later and not having your items in your cart is annoying, right?

To enable file-based storage, choose it during installation or in your app/etc/local.xml file simply make sure you have a session_save tag like this:

1
<session_save><![CDATA[files]]></session_save>

Note: Look in app/etc/local.xml.additional for examples but ignore the comment about empty defaulting to files, you need the word files in there.

I have performance benchmarked filesystem storage in the Benchmark section below.

Database Session storage

Database session storage is the other storage type, the one you probably didn't choose during install, and forgot to circle back round and find out if you should have. With database session storage the session data is stored in the Magento MySQL database. The connection used is the same as the core connection.

One of the key benefits of using database sessions is the clustered environment support. In a filesystem based session storage scheme, if you have more than one Magento frontend node in a cluster, they will need to share session data (unless you use a loadbalancer with sticky sessions) and the database gives you that capability quite easily.

Databases also have good stability and durability during crashes and reboots.

One of the problems with database session storage is that it adds more load to the database. On large catalog sites with many SKUs, or busy sites with lots of sessions, this can hurt the database performance.

To use the database for session storage simply have this in your local.xml:

1
<session_save><![CDATA[db]]></session_save>

Check out the benchmarks below to see how well database session storage performs.





Regards,

 
 HERY PURNAMA
 
MCDBA, ITILF, PMP, CISA
 IT & Management Trainer

 http://www.inhousetrainer.net
 inhousetrainer@yahoo.com , hery.purnama@gmail.com
 Call/ SMS/WA :  081.223344.506 | PinBB : 7DC633AA
 
 Blog :
 inhousetrainer.blogspot.com
 freelance-it-trainer.blogspot.com
 
 Social Net :
 facebook.com/inhousetrainer
 twitter.com/inhousetrainer
 instagram.com/inhousetrainer
 
 

Comments

Popular posts from this blog

Sewa Ruang Meeting Daerah Citarum Bandung

Sewa ruang meeting kantor, training di Bandung Hubungi 0816-4038-78. Lokasi Ruang Meeting berada di Jl.Pelajar Pejuang 45 No.23B 1. Paket per Jam      - Biaya : Rp.50.000 / org / jam     - Fasilitas : Snack & Drink 2. Paket Half-Day     - Waktu : 09.00 s/d 13.00 Wib     - Biaya : Rp.120.000 / org      - Fasilitas : Makan siang 1x, Snack & Drink 3. Paket Full Day     - Waktu : 09.00 s/d 16.00 Wib     - Biaya : Rp.170.000 / org      - Fasilitas : Makan siang 1x, Coffe break 2x, Snack & Drink 4. Lain-lain     - Sewa Proyektor : Rp.150.000/day     - Extra time : Rp.100.000/Jam Syarat dan Ketentuan : 1. Min. 3org dan Max. 7org 2. Pembayaran H-3 sebelum tgl pelaksanaan 3. Melebihi jam ketentuan dikenakan biaya tambahan Sewa Ruang Meeting Daerah Citarum Bandung Hubungi 0816-4038-78 Ruang meeting murah mulai 50.000 di Buah Batu, Pasteur, Sukajadi, Lengkong, Antapani, Uj...

reaksi Blesteran Bule Di Pijitin Tukang Urut. - Youtube | www.pijat.xyz

Reaksi Blesteran Bule Di Pijitin Tukang Urut. - Youtube Yang Ditemukan Pada Tautan www.pijat.xyz Adalah Update Tukang Urut Terdekat Dari Lokasi Saya Terbaru Pada Hari Ini 11 Jun 2020 Yang Terkait Dengan Pencarian Tukang Urut Terdekat Dari Lokasi Saya Mengenail Detail reaksi Blesteran Bule Di Pijitin Tukang Urut. - Youtube Dan Beberapa Ulasan Lain Dari tukang Urut Terdekat Dari Lokasi Saya Sudah Menjadi Trending Populer Di Internet, Lalu Apakah Arti Atau Yang Dimaksud Dengan Reaksi Blesteran Bule Di Pijitin Tukang Urut. - Youtube Seperti Yang Ditemukan Pada Website Www.pijat.xyz Dan Dimanakah Lokasi Informasi Terkait Tukang Urut Terdekat Dari Lokasi Saya ? Apakah Headline Utama Dari Tukang Urut Terdekat Dari Lokasi Saya , Trending Topik Saat Ini Atau Info Reaksi Blesteran Bule Di Pijitin Tukang Urut. - Youtube Adalah Informasi Tukang Urut Terdekat Dari Lokasi Saya Plus Plus Di Kota Anda, Silahkan Akses Detailnya Dengan Download Gratis Terkait Tukang Urut Terdekat Dari Loka...

Lowongan Trainer SEO & Internet Marketing (Freelance Bandung), Fee Rp 600 rb/ Hari

SISINDOTEK sebuah perusahaan yang bergerak di bidang IT Training & Solution Provider di Bandung membutuhkan Tenaga trainer untuk subject : Trainer SEO & Internet Marketing Bandung - Jawa Barat Requirements: D3/ S1 Jurusan Informatika (Terbuka untuk mahasiswa yang mahir SEO) Berpengalaman mengajar minimal 1 tahun atau menguasai SEO dengan baik Berdomisili di Bandung dan sekitarnya Menguasai Teknik dan metode SEO dengan baik Bisa menunjukkan prestasi atas SKILL SEO yang dimiliki (Top Rangking Google atas Blog atau Web yang pernah ditangani SEO nya) Memiliki nilai tambah jika pernah memenangkan Kontes SEO Kompensasi : Kompensasi Rp 450.000 - 700.000 / Hari (Tergantung skill, pengalaman dan sertifikasi) * Waktu mengajar : 09.00 - 17.00 diselingi 2x coffee break dan 1 x lunch selama 3 hari berturut turut. CV lengkap di kirim ke : hrd sebelum 20 Juni 2012, hanya yang memenuhi persyaratan yang akan dipanggil untuk mengikuti sesi Interview dan Test mengajar