search
HomeDatabaseMysql Tutorial可靠的Windows版Redis

可靠的Windows版Redis

Jun 07, 2016 pm 04:10 PM
rediswindowsteach youWonderfulComment

副标题: 评论更精彩,教你怎么解决64位Windows版Redis狂占C盘的问题. MS Open Tech 技术团队最近花了很多时间来测试最新构建的Windows版Redis(可在 MS Open Tech Github 仓库下载). 当我们测试计划快要完成时,我们认为应该分享一些振奋人心的结果。 在压力测


副标题: 评论更精彩,教你怎么解决64位Windows版Redis狂占C盘的问题.

MS Open Tech 技术团队最近花了很多时间来测试最新构建的Windows版Redis(可在 MS Open Tech Github 仓库下载). 当我们测试计划快要完成时,我们认为应该分享一些振奋人心的结果。

在压力测试的第一阶段,我们让Redis在Windows上进行各种测试,执行时间从1天到16天,以及简单的单master配置,到如下图所示的更复杂的配置,包括1个Master以及4个replicas。 你可以在 我们的wiki页面 看到使用的总体测试策略和配置.

\

测试结果令人振奋 —— 我们只发现了一个 BUG,当然我们已经修正了.

这些已经完成的测试是基于Linux版的Redis2.6.8迁移到 Windows 版的, 这个版本完成了我们在1月宣布的所有目标, 比如支持64位系统。 我们的目标是确保开发者可以放心地在Windows上使用Redis,包括高靠性要求的业务场景. 我们计划继续在更“严苛”的场景中进行测试, 确保我们没有漏过任何东西。

如果您对业务场景和测试计划/策略有什么意见或建议,请务必告诉作者们。 我们很乐意使用Redis开发者觉得适合的任意app或场景。

评论更精彩

1楼:

很高兴看到你们的进步. 我们喜欢在分布式项目中使用Redis,但一直运行独立的linux服务器或Redis专属的虚拟机上。 当然这也不是什么大事啦,根据具体情况决定吧。

干得不错!(Good work!)

2楼:

Good work! 做windows上做开发或者简单测试时确实是不错的。

3楼:

Redis 2.8.12 —— 我有两个版本的 redis-server.exe : 一个是32位,另一个是64位, 在启动这两个版本时都会创建一个 RedisQFork.dat文件, 当我运行32位exe时这个文件的大小是500 MB, 而运行64位时RedisQFork.dat文件变成了 16GB,这就是问题所在。

那么请问有什么方法(比如配置某些参数)能让Redis不去创建这个16GB 的文件吗?(顺便说一下我的服务器是 windows 2012, 所以我希望能使用64位的exe), 回到问题… 我想说的是有没有什么办法让redis不要去创建这个巨大的文件,或者假如必须创建这个文件, 那有什么办法可以让Redis去其他磁盘或网络上(unc路径)创建呢, 比如有大容量存储空间的地方。

你能顺便解释一下这个文件的作用是什么吗。

谢谢!

4楼:

我也遇到了和 Rushdeep 一样的问题, 就是在64位版本上 RedisQFork_nnnn.dat 文件占用16GB磁盘空间的问题. 这是一个bug吗?

5楼:

我碰到了同样的问题. 我不确定 RedisQFork 文件是否变小一点, 但我确定, 你可以通过设置Redis启动参数 heapdir 来调整这个文件的位置. 例如: redis-server.exe -heapdir D:\redisdata

铁锚备注:

当然啦,铁锚也碰到这个问题好久了.今晚上被 向上老大指点了一番, 知道了人生不应该瞎混的道理,所以回家来就着手解决这个问题,百度一搜 RedisQFork,就发现了这篇文章,当然,按照5楼的处理思路,这个算是解决了.

我在 redis.windows.conf文件中搜索 "heapdir",然后在默认注释掉的内容下面添加一行,指定Redis内存映射文件(memory mapped file)存放的路径:

# heapdir指定内存映射文件路径名,不能是文件名
# heapdir <directory path(absolute or relative)>
heapdir D:/temp/redis_heapdir/

具体文件和目录就请你根据自己的磁盘进行指定啦. 我的症状和情况是这样的, 16GB内存,Windows版64bit的Redis,启动Redis后就在C盘的 C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Redis 目录下面生成一个16GB大小的 RedisQFork_8792.dat 文件(8792是本次启动的进程PID, 关闭redis 则此文件自动被删除). 本来当初为了省钱只上了64GB的固态硬盘,结果16G一吃下来,C盘就只有16GB空余空间,自从设置到D盘,重启以后,感觉强迫症就好多了。

当然,铁锚要废话不是想说这些,而是想引入2个参数:

# maxheap指定最大heap字节数,比如 10000000
# maxheap <bytes>

# maxmemory 指定最大使用内存,单位:字节
# maxmemory <bytes>

具体的参数请参考配置文件内的说明,一搜索就知道.(主要是铁锚配置这两个参数就一直出错,半天启动不起来,等研究明白再说吧.)

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
MySQL: BLOB and other no-sql storage, what are the differences?MySQL: BLOB and other no-sql storage, what are the differences?May 13, 2025 am 12:14 AM

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

MySQL Add User: Syntax, Options, and Security Best PracticesMySQL Add User: Syntax, Options, and Security Best PracticesMay 13, 2025 am 12:12 AM

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

MySQL: How to avoid String Data Types common mistakes?MySQL: How to avoid String Data Types common mistakes?May 13, 2025 am 12:09 AM

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

MySQL: String Data Types and ENUMs?MySQL: String Data Types and ENUMs?May 13, 2025 am 12:05 AM

MySQloffersechar, Varchar, text, Anddenumforstringdata.usecharforfixed-Lengthstrings, VarcharerForvariable-Length, text forlarger text, AndenumforenforcingdataAntegritywithaetofvalues.

MySQL BLOB: how to optimize BLOBs requestsMySQL BLOB: how to optimize BLOBs requestsMay 13, 2025 am 12:03 AM

Optimizing MySQLBLOB requests can be done through the following strategies: 1. Reduce the frequency of BLOB query, use independent requests or delay loading; 2. Select the appropriate BLOB type (such as TINYBLOB); 3. Separate the BLOB data into separate tables; 4. Compress the BLOB data at the application layer; 5. Index the BLOB metadata. These methods can effectively improve performance by combining monitoring, caching and data sharding in actual applications.

Adding Users to MySQL: The Complete TutorialAdding Users to MySQL: The Complete TutorialMay 12, 2025 am 12:14 AM

Mastering the method of adding MySQL users is crucial for database administrators and developers because it ensures the security and access control of the database. 1) Create a new user using the CREATEUSER command, 2) Assign permissions through the GRANT command, 3) Use FLUSHPRIVILEGES to ensure permissions take effect, 4) Regularly audit and clean user accounts to maintain performance and security.

Mastering MySQL String Data Types: VARCHAR vs. TEXT vs. CHARMastering MySQL String Data Types: VARCHAR vs. TEXT vs. CHARMay 12, 2025 am 12:12 AM

ChooseCHARforfixed-lengthdata,VARCHARforvariable-lengthdata,andTEXTforlargetextfields.1)CHARisefficientforconsistent-lengthdatalikecodes.2)VARCHARsuitsvariable-lengthdatalikenames,balancingflexibilityandperformance.3)TEXTisidealforlargetextslikeartic

MySQL: String Data Types and Indexing: Best PracticesMySQL: String Data Types and Indexing: Best PracticesMay 12, 2025 am 12:11 AM

Best practices for handling string data types and indexes in MySQL include: 1) Selecting the appropriate string type, such as CHAR for fixed length, VARCHAR for variable length, and TEXT for large text; 2) Be cautious in indexing, avoid over-indexing, and create indexes for common queries; 3) Use prefix indexes and full-text indexes to optimize long string searches; 4) Regularly monitor and optimize indexes to keep indexes small and efficient. Through these methods, we can balance read and write performance and improve database efficiency.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),