Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Redis

You're reading from   Mastering Redis Take your knowledge of Redis to the next level to build enthralling applications with ease

Arrow left icon
Product type Paperback
Published in May 2016
Publisher Packt
ISBN-13 9781783988181
Length 366 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Vidyasagar N V Vidyasagar N V
Author Profile Icon Vidyasagar N V
Vidyasagar N V
Jeremy Nelson Jeremy Nelson
Author Profile Icon Jeremy Nelson
Jeremy Nelson
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Why Redis? FREE CHAPTER 2. Advanced Key Management and Data Structures 3. Managing RAM – Tips and Techniques for Redis Memory Management 4. Programming Redis Part One – Redis Core, Clients, and Languages 5. Programming Redis Part Two – Lua Scripting, Administration, and DevOps 6. Scaling with Redis Cluster and Sentinel 7. Redis and Complementary NoSQL Technologies 8. Docker Containers and Cloud Deployments 9. Task Management and Messaging Queuing 10. Measuring and Managing Information Streams A. Sources Index

32-bit Redis

In the official documentation on Redis.io's website on Memory Optimization3, one suggestion is to compile Redis in 32-bit mode instead of using the default 64 bit instance.

32-bit Redis

Using a 32-bit Redis instances for datasets under 3 GB is smaller than the same dataset in the 64-bit version of Redis. This can be illustrated in the following tests. We'll launch two Redis instances, INSTANCE64 and INSTANCE32. We'll create a quick Python function, test_redis_32k_65k, in a Python command line to create 100,000 keys using a UUID as a string value:

>>>def test_redis_32k_64k():
  for i in range(100000):
    key = "uuid:{}".format(i)
    value = uuid.uuid4()
    INSTANCE32.set(key, value)
    INSTANCE64.set(key, value)
>>> test_redis_32k_64k()

To see what happens to the memory usage of 32-bit verses 64-bit type of Redis instances, we'll compare the output of two Redis-cli sessions by connecting to each instance.

For the Redis 32-bit instance:

127...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime