Saturday, August 24, 2013

Load Balancing Issue with Symfony2 and Session

I am going to explain the problem with symfony2 and a load balancing scenario.

If  you are using Round Robin load balancing technique for symfony2 application, your session storage must be database driven.

Below is the configuration for database driven session storage in symfony2 application:

# app/config/config.yml

        db_table: session
        db_id_col: session_id
        db_data_col: session_value
        db_time_col: session_time

        class: PDO
            dsn:      "mysql:dbname=mydatabase"
            user:     myuser
            password: mypassword
        class: Symfony\Component\HttpFoundation\SessionStorage\PdoSessionStorage
        arguments: ["@pdo", "", "%pdo.db_options%"]

Here is the reference article about this: How to use PdoSessionStorage to store Sessions in the Database


  1. I have a similar issue which define in this post and finally i get the solution from here. Thanks! Android Event App

  2. Thanks for sharing, nice post!
    Chia sẻ các bạn cách làm gà chiên giòn cực ngon hay cách chữa răng ê buốt tại nhà hiệu quả hay bà bầu bị táo bón có nên rặn hay loai ran doc nhat the gioi hay cách làm mồi câu cá rô phi đơn giản và hiệu quả hay CMNR là gì và nguồn gốc của nó hay bà bầu có nên ăn ốc không. Giải mã giấc mơ thấy rắn - Nằm mơ thấy rắn là điềm gì sẽ giúp các bạn giải đáp các thắc mắc về nằm mơ thấy rắn.

  3. Thank you for this wonderful information with us. It was helpful.

    Catering Services in Adyar

  4. Wonderful article, very useful and well explanation. Your post is extremely incredible. I will refer this to my friends to visit your post

    Seo Company in Chennai

  5. nice blog too informative. looking and reading your points its so impressive. doing more blog like this. i really appreciated doing like this.
    Digital Marketing Course in Chennai

  6. I was reading your web designing post. It was amazing and nice information Great lists that really presents at lot of interesting examples.
    Web development Company in India Company | Web development Company Bangalore
    Web Development Company in Bangalore | Responsive Web development

  7. In this e-world, a business or an industry can prove its potential through its web presence.
    web development company

  8. This blog having the details of Processes running. The way of runing is explained clearly. The content quality is really great. The full document is entirely amazing. Thank you very much for this blog.
    Digital Marketing Company in India

  9. This article is very much helpful and i hope this will be an useful information for the needed one. Keep on updating these kinds of informative things...
    iOS Training in Chennai
    Android Training in Chennai
    php Training in Chennai

  10. Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.thank you for sharing such a great blog with us. expecting for your.
    Digital Marketing Company in India
    Seo Company in India

  11. Where else could I get that type of information written in such an ideal means?

  12. This is my first time i visit here. I found so many entertaining stuff in your blog, especially its discussion. From the tons of comments on your articles ...
    content writing Ottawa

  13. Good and nice information, thanks for sharing your views and ideas.. keep rocks and updating.

    PHP Training in chennai | PHP Training institute in chennai

  14. Thanks for your marvelous posting! It is very useful and good. Come on. I want to introduce the best aso services for you, I try it and I feel it is so good to rank app to top in app store search results, have you ever heard it?

  15. Domain hosting wiki: for bloggers, business owners and webmasters looking for starting, maintaining and knowing more about domains and hosting

  16. It was really helpful. Great explanation.
    Eagan Web Design

  17. These things are essential, great think so - I suspect as much as well..
    internet marketing services