Home >Database >Redis >How many keys can a redis instance store?

How many keys can a redis instance store?

anonymity
anonymityOriginal
2019-06-05 13:20:258968browse

There are a total of 16 dbs numbered 0-15 in redis, and db0 is used by default

In reidis, how to separate different application data from each other while storing it in the same What about instances? It is equivalent to a mysql database. Different application data are stored in different databases.

How many keys can a redis instance store?

#In redis, the database is identified by an integer index rather than a database name. By default, a client connects to database 0. The following parameters in the redis configuration file control the total number of databases:

databases 16

You can switch to different databases through the following commands

select 1

ps: In the redis cluster, the select command cannot be used , because the redis cluster only supports db0

Each database has its own space, so there is no need to worry about key conflicts between them.

Under different databases, the same key gets its own value.

How many keys can a redis instance store?

Officially said that a single instance can handle 250 million keys, reference link: https://redis .io/topics/faq, the following is the original words:

What is the maximum number of keys a single Redis instance can hold? and what the max number of elements in a Hash, List, Set, Sorted Set?
Redis can handle up to 2^32 keys, and was tested in practice to handle at least 250 million keys per instance.
Every hash, list, set, and sorted set, can hold 2^32 elements.
In other words your limit is likely the available memory in your system.

The maximum size of a key or value is 512M

The above is the detailed content of How many keys can a redis instance store?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn