ImageVerifierCode 换一换
格式:DOCX , 页数:3 ,大小:16.33KB ,
资源ID:3391369      下载积分:2 积分
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝扫码支付 微信扫码支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.wnwk.com/docdown/3391369.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Redis on Windows.docx)为本站会员(a****2)主动上传,蜗牛文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知蜗牛文库(发送邮件至admin@wnwk.com或直接QQ联系客服),我们立即给予删除!

Redis on Windows.docx

1、MSOpenTechs Redis on WindowsWe strive to have a stable, functionally equivalent and comparably performing version of Redis on Windows. We have achieved performance nearly identical to the POSIX version running head-to-head on identical hardware across the network. Aside from feature differences that

2、 help Redis take advantage of the Windows infrastructure, our version of Redis should work in most situations with the identical setup and configuration that one would use on a POSIX operating system.How is Redis on Windows implemented?Redis is a C code base that compiles under Visual Studio. Most o

3、f the code compiles with only minor changes (due to syntactical differences between compilers and low-level API differences on Windows). There are a few areas where there are significant differences in how efficient Windows programs operate relative to POSIX programs. We have encapsulated most these

4、 differences in a platform specific library. The areas where there are significant differences are: Networking APIs POSIX File Descriptors POSIX fork() Logging Windows Services APINetworking DifferencesThe Windows networking stack is split between user mode code and kernel mode code. Transitions bet

5、ween user and kernel mode are expensive operations. The POSIX networking APIs on Windows utilize a programming model that incurs significant performance loss due to the kernel/user mode transitions. Efficient Windows networking code instead uses the IO Completion Port model to reduce the impact of t

6、his behavior. The APIs used and the programming model for IO Completion is different enough that we were forced to implement a new networking layer in Redis.File DescriptorsIn a POSIX operating system, all data sources (files, pipes, sockets, mail slots, etc.) are referenced in code with a handle ca

7、lled a file descriptor. These are low value integers that increment by one with each successive file descriptor creation. All POSIX APIs that work with file descriptors will function without the programmer having to know what kind of data source a file descriptor represents. On Windows, each kind of

8、 data source has a separate kind of HANDLE. APIs that work with one HANDLE type will not work with another kind of HANDLE. In order to make Redis operate with its assumptions about file descriptor values and data source agnosticism, we implemented a Redis File Descriptor API layer.fork()The POSIX ve

9、rsion of Redis uses the fork() API. There is no equivalent in Windows, and it is an exceedingly difficult API to completely simulate. For most of the uses of fork() we have used Windows specific programming idioms to bypass the need to use a fork()-like API. The one case where we could not do so was

10、 with the point-in-time heap snapshot behavior that the Redis persistence model is based on. We tried several different approaches to work around the need for a fork()-like API, but always ran into significant performance penalties and stability issues. Our current approach is to simulate the point-

11、in-time snapshot behavior aspect of fork() without doing a complete simulation of fork(). We do this with the system-paging file that contains the Redis heap. When a fork() operation is required we do the following: Mark every page in the heap with the Copy on Write page protection Start a child pro

12、cess and pass it the handle to the heap mapped to the system-paging file Signal the child to start the AOF or RDB persistence process on the memory shared via the system-paging file Wait (asynchronously) for the child process to finish Map the changes in the Redis heap that occurred during the fork(

13、) operation back into the parent process heap.The upside with this implementation is that our performance and stability is now on par with the POSIX version of Redis. The down side is that we have a runtime system-paging file space requirement for Redis. A system-paging file at least of the size of

14、physical memory is suggested.The default configuration of Windows allows the page file to grow to 3.5 times the size of physical memory. There are scenarios where 3rd party programs also compete for system paging file space at runtime.LoggingIn addition to file-based logging, the POSIX version of Re

15、dis supports logging via the syslog facility. The equivalent in Windows is the Event Log. With the addition of the Windows Service code we have added support for logging to the Event Log. We have mapped the syslogxxxx flags for this purpose.Windows ServiceIn version 2.8.9 we added support to make Re

16、dis operate as a service. See the “Windows Service Documentation.docx” file included with the GitHub binary distribution for a description of the service commands available. Redis on Windows Best PracticesBinary DistributionsThe GitHub repository should be considered a work in progress until we rele

17、ase the NuGet and Chocolatey packages and tag the repository at that released version. For instance, the Windows Service feature has taken many iterations with community input to get right. Since the initial Windows service code was checked we have added the following to the service based on communi

18、ty input: Self-elevation of the Redis executable so that service commands would work from a non-elevated command prompt. Service naming so that multiple instances of the Redis service could be installed on one machine. Automatically adjusting folder permissions so that when Redis is run under the NE

19、TWORK SERVICE account it could modify the files in the installation directory. Moved all of the pre-main() error reporting code (service and quasi-fork code) that could write errors to stdout to use the Redis logging code. This allows service initialization errors to reach the Event Log. This requir

20、ed intercepting all of the command line and conf file arguments before main() in order to properly initialize the logging engine. There were several fixes related to the intricacies of how to interpret the arguments passed to Redis.Heap SizingNative heaps are prone to fragmentation. If we are not ab

21、le to allocate more heap space due to fragmentation, Redis will flag the problem and exit. Unlike the POSIX version of Redis, our heap size is constrained by the system-paging file space. It is important to consider how much data you are expecting to put into Redis, and how much fragmentation you ar

22、e likely to see in the Redis heap. High levels of fragmentation of the heap may cause to run into an out of heap space. In this case, an increase of the size of the system-paging file may solve the problem.Installation and MaintenanceSince Redis uses the system-paging file, the most stable configura

23、tions will only have Redis running on essentially a virgin operating system install. Redis is xcopy deployable. There should be no problem upgrading versions by simply copying new binaries over old ones (assuming they are not currently in use). Service AccountWhen using Redis as a Windows service, t

24、he default installation configures Redis to run under the systems NETWORK SERVICE account. There are some environments where another account must be used (perhaps a domain service account). Configuration of this account needs to be done manually at this point with the service control manager. If this is done, it is also important to give read/write/create permission to the folder that the Redis executable is in to this user identity.

copyright@ 2008-2023 wnwk.com网站版权所有

经营许可证编号:浙ICP备2024059924号-2