Tuesday, 20 March 2012

Keeping PHP Sessions on Memcached

This happens to be one of the areas where the production/stage setup is different from our local setups. On prod/stage, PHP sessions are stored in memcached. What that does is that it makes it impossible to store medium - large chunks of data in the session. Doing that is anyhow not advisable.
When an attempt is made to write a large piece of data to the session, it results in a write failure from php to memcached. Subsequently, a read failure from memcached immediately follows.
In cases where session information is needed, this results in irregular behavior. In our case, it resulted in content console users being logged out. The failure can be different in different cases but the pattern will be the same.

Check: PHP error logs, SELinux context (if SELinux is enabled) etc.
Clues: Failures occur more irregularly when there is a write failure as discussed. The failures are more regular with SELinux issues.

The fix for the SELinux issue is simple. Just check:
# getsebool httpd_can_network_memcache

That should output:
httpd_can_network_memcache --> on

If it outputs an off, just do:
# setsebool -P httpd_can_network_memcache 1

As simple as that.

56 comments:

  1. PHP or Hypertext Preprocessor is the most preferred programming language in the world, used for dynamic website development and web based applications. This server side scripting language has been used to develop some of the most popular website such as Facebook and Wikipedia.
    php

    ReplyDelete
  2. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    Php course in chennai

    ReplyDelete
  3. Those guidelines additionally worked to become a good way to
    recognize that other people online have the identical fervor like mine
    to grasp great deal more around

    white label website builder

    ReplyDelete
  4. But it tracks every visitor to that page so now you can see the number of views your page is getting. Not just the number of clicks the link gets. And all from one central secure dashboard sitting on your server. Quality Backlinks Niche

    ReplyDelete
  5. Nice post By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision.
    Web Design Training

    ReplyDelete
  6. I am thankful for this blog to gave me much knowledge regarding my area of work. I also want to make some addition on this platform which must be in knowledge of people who really in need. Thanks.
    white label website builder

    ReplyDelete
  7. Thanks for posting useful information.You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...Really it was an awesome article...very interesting to read..please sharing like this information......
    PHP interview questions

    ReplyDelete
  8. thanks for sharing this article to us , it is very nice article and good post thanks for sharing this article to us
    i really like this article because i got good info about this article thanks for haring this article to us .best regards.
    mainframe training in hyderabad

    ReplyDelete
  9. Thanks for taking time to share this wonderful article with us. I'm looking forward to learn more from your blogs. Keep us updated.

    WordPress Training in Chennai

    ReplyDelete
  10. Baca berikut ini contoh mantra judi kartu yang terkadang digunakan bettor! Anda bisa coba lebih dulu atau tanyalah pada siapa saja yang memang sempat menggunakan cara tersebut sampai mereka sukses dan sukses dengan mantra itu.
    asikqq
    dewaqq
    sumoqq
    interqq
    pionpoker
    bandar ceme terpercaya
    hobiqq
    paito warna
    forum prediksi

    ReplyDelete
  11. Awesome post. I am a normal visitor of your blog and appreciate you taking the time to maintain the excellent site. I’ll be a frequent visitor for a long time.

    ACP Sheet
    ACP Sheet Price
    Aluminium Composite Panel
    ACP Panel
    ACP Sheets

    ReplyDelete
  12. smart outsourcing solutions is the best outsourcing training
    in Dhaka, if you start outsourcing please
    visit us: Freelancing training in bangladesh
    Outsourcing training in dhaka
    Outsourcing training in bangladesh

    ReplyDelete
  13. Such A nice post... thanks For Sharing !!Great information for new guy like Happy New year 2020

    ReplyDelete
  14. Great Article. Thank you for sharing! Really an awesome post for every one.

    IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.

    JavaScript Training in Chennai

    JavaScript Training in Chennai

    ReplyDelete
  15. Such A nice post... thanks For Sharing !!Great information for new guy like showbox for android

    ReplyDelete
  16. Such A nice post... thanks For Sharing !!Great information for new guy like antimalware service executable

    ReplyDelete
  17. Great Article. Thank you for sharing! Really an awesome post for every one.

    IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.

    Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
    Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

    ReplyDelete
  18. Great Article. Thank you for sharing! Really an awesome post for every one.

    IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.

    Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
    Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

    ReplyDelete
  19. thanks for the post were very helpful.have a great start and better future...
    qr code generator

    ReplyDelete
  20. keep up the good work. this is an Assam post. this to helpful, i have reading here all post. i am impressed. thank you. this is our digital marketing training center. This is an online certificate course
    digital marketing training in bangalore / https://www.excelr.com/digital-marketing-training-in-bangalore

    ReplyDelete
  21. Thank you for the information and updates. I just stumbled upon your blog and wanted to say that I have really enjoyed browsing your blog posts.
    Selenium courses in Pune

    ReplyDelete
  22. Here is the details of BMIT (Medical Imaging Technology) colleges in Bangalore. If you are looking to study BMIT in Bangalore, the below will help you to find the best BMIT colleges in Bangalore.

    BSc Medical Imaging Technology Colleges in Bangalore | Medical Imaging Technology Colleges in Bangalore |

    ReplyDelete
  23. Here is the details of B.Sc Optometry colleges in Bangalore. If you are looking to study BSc Optometry in Bangalore, the below will help you to find the best Optometry colleges in Bangalore.
    BSc Optometry Colleges in Bangalore | Optometry Colleges in Bangalore |

    ReplyDelete
  24. Here is the details of B.Sc Renal Dialysis Technology colleges in Bangalore. If you are looking to study BSc Renal Dialysis Technology in Bangalore, the below will help you to find the best Renal Dialysis Technology colleges in Bangalore.
    BSc Renal Dialysis Colleges in Bangalore | Renal Dialysis Technology Colleges in Bangalore |

    ReplyDelete
  25. Here is the details of B.Sc Respiratory Care Technology colleges in Bangalore. If you are looking to study BSc Respiratory Care Technology in Bangalore, the below will help you to find the best Respiratory Technology colleges in Bangalore.
    BSc Respiratory Care Technology Colleges in Bangalore | Respiratory Care Colleges in Bangalore |

    ReplyDelete
  26. Here is the details of B.Sc Cardiac Care Technology colleges in Bangalore. If you are looking to study BSc Cardiac Care Technology in Bangalore, the below will help you to find the best Cardiac Care Technology colleges in Bangalore.
    BSc Cardiac Care Technology Colleges in Bangalore | Cardiac Care Colleges in Bangalore |

    ReplyDelete
  27. Here is the details of B.Sc Perfusion Technology colleges in Bangalore. If you are looking to study BSc Perfusion Technology in Bangalore, the below will help you to find the best Perfusion Technology colleges in Bangalore.
    BSc Perfusion Technology Colleges in Bangalore | Perfusion Technology Colleges in Bangalore |

    ReplyDelete
  28. Great post!!! Thanks for sharing this wonderful blog with us...
    Software Testing Course in Bangalore

    ReplyDelete