Optimization of Redis


In this Post, I am going to cover how to optimized REDIS  (recently i was reading this random blog giving more clear insight on what is redis and what the use of it in real world) instances as per our requirement. if you are not aware about REDIS at all, you can refer to my previous post where i have covered


  1. How To install REDIS on Centos/Redhat servers which goes here.
  2. How To Create Multiple instances of REDIS which goes here.
  3. What is the Best Standard method to configure REDIS which goes here.

So, Lets see how to optimize our redis server. few points you need to keep in mind that which are important while doing optimization and we are going to learn more about shortly.



For Freelance Work & Queries Contact me by Email Id support@linuxforeveryone.com


  1. Remove any errors you are seeing under redis logs
  2. Check the amount of cache size your site is using for each port
  3. Set proper eviction policy for redis keys
  4. Set proper kernel Settings to make redis run properly.


1) Disable HugePage for kernel


  • # echo never > /sys/kernel/mm/transparent_hugepage/enabled
  •  Add above line in /etc/rc.local file as well so that after server reboot it should be there,else your optimized value will be vanish.





2) Tcp-backlog


  • echo 511 > /proc/sys/net/core/somaxconn 
    •  add it to your /etc/rc.local as well

     3)Maxmemory 



      •   For Full Page Cache set =  (as per the data you get by running below command + 500 MB)
      •   For session/cache = (as per the data you get by running below command + 200 MB)

      Command :   redis-cli -h [Redis Local IP] -p [redis_port] info | grep "used_memory.*human"


      4) Maxmemory-policy

        • maxmemory-policy allkeys-lru

          5) To avoid background save fail under low memory condition

          • Add 'vm.overcommit_memory = 1' to /etc/sysctl.conf (if not present)
          • Run command "sysctl vm.overcommit_memory=1" as root (if not present)




          Comments

          1. I could not resist commenting. Exceptionally well written!

            ReplyDelete
          2. Excellent, what a web site it is! This website presents helpful data to
            us, keep it up.

            ReplyDelete
          3. Thanks for finally talking about >"Optimization of Redis"
            <Liked it!

            ReplyDelete
            Replies
            1. Yup, thats the idea ! of sharing what I know. Glad you liked it.

              Delete
          4. Wow! This blog looks just like my old one! It's on a
            entirely different subject but it has pretty much the same layout and design.
            Outstanding choice of colors!

            ReplyDelete
            Replies
            1. Thank you :) you can share you old one for me to view if you like.

              Delete
          5. I do believe all of the concepts you've offered to your post.
            They're really convincing and can definitely work.
            Nonetheless, the posts are too brief for novices.
            Could you please prolong them a bit from subsequent time?
            Thanks for the post.

            ReplyDelete
            Replies
            1. Thank you for your input, I will definitely try this from next post :)

              Delete
          6. I don't even know how I ended up here, but
            I thought this post was good. I don't know who you are but
            definitely you are going to a famous blogger if you are not
            already ;) Cheers!

            ReplyDelete
          7. I do trust all of the ideas you have offered for
            your post. They are very convincing and will
            definitely work. Nonetheless, the posts are very brief for novices.
            May you please lengthen them a little from next time?

            Thanks for the post.

            ReplyDelete
          8. Thank you :)
            Its google blog, you can also use it for free :)

            ReplyDelete
          9. There's definately a lot to find out about this issue.
            I really like all the points you have made.

            ReplyDelete
          10. I'm truly enjoying the design and layout of your blog. It's
            a very easy on the eyes which makes it much
            more pleasant for me to come here and visit more often.
            Did you hire out a developer to create your theme? Superb work!

            ReplyDelete
            Replies
            1. Thank you :) nope its Google blog theme, anyone can use it for free :)

              Delete
          11. I have been browsing online greater than 3 hours today, but I never found any attention-grabbing article like yours.
            It is pretty price sufficient for me. In my opinion, if all website owners and bloggers
            made excellent content as you did, the internet
            shall be much more helpful than ever before.

            ReplyDelete
          12. For most up-to-date news you have to pay a visit world wide web and on world-wide-web I found this site
            as a finest web page for newest updates.

            ReplyDelete
          13. Hi, I do think this is an excellent website. I stumbledupon it ;) I will
            come back yet again since I book-marked it. Money and freedom is the best way
            to change, may you be rich and continue to guide others.

            ReplyDelete
          14. In fact when someone doesn't be aware of afterward
            its up to other viewers that they will assist, so here it happens.

            ReplyDelete
          15. I will glad to know how my blog helped you. Thanks :)

            ReplyDelete
          16. It's really a nice and helpful piece of info. I am happy
            that you simply shared this helpful information with us.
            Please stay us up to date like this. Thank you for sharing.

            ReplyDelete
            Replies
            1. Thank you :) You can refer this blog which i was recently reading, it will give some more insight how redis helped someone.

              https://blogs.perficientdigital.com/2018/09/18/using-caching-technology-to-boost-e-commerce-business/

              Delete

          Post a Comment