Hash Slot Resharding and Rebalancing for Redis Cluster

https://severalnines.com/database-blog/hash-slot-resharding-and-rebalancing-redis-cluster Redis Cluster with automatic partitioning uses a cool approach in organizing and storing the data, where the keys are stored in a hash slot and the keyspace is... Read More | Share it now!

Rotating Logs With Logrotate in Linux

A common issue is when you first setup a daily logrotate.d entry, it will not rotate the first day. When you use a time based rotation (daily/weekly/monthly) logrotate scribbles a date stamp of the last date it saw the file... Read More | Share it now!

Redis ssl

TLS Support SSL/TLS is supported by Redis starting with version 6 as an optional feature that needs to be enabled at compile time. Getting Started Building Redis git: https://github.com/redis/redis To build with TLS support you’ll need OpenSSL... Read More | Share it now!

Flatbuffers Install

https://stackoverflow.com/questions/55394537/how-to-install-flatc-and-flatbuffers-on-linux-ubuntu solution for flatc and flatbuffers for linux ubuntu : choice “folder for installation” cd “folder for installation” git... Read More | Share it now!

CURL with time printed

cURL supports formatted output for the details of the request (see the cURL manpage for details, under -w, –write-out <format>). For our purposes we’ll focus just on the timing details that are provided. Times below are... Read More | Share it now!

uWSGI缓存框架

https://uwsgi-docs-zh.readthedocs.io/zh_CN/latest/Caching.html uWSGI包含了一个非常快速、全内存访问、零IPC、SMP安全、不断优化、高度可调的、键值存储的简单的“缓存框架”。单个uWSGI实例可以使用不同的设置,出于不同的目的,创建无限个不同的“缓存”。 创建一个“缓存” 要创建一个缓存,你可以使用 --cache2 选项。它接收指定缓存选项的参数字典。要有一个有效的缓存,你需要指定它的名字,以及它可以包含的项的最大数目。 uwsgi... Read More | Share it now!

How to trigger a Kubernetes cronjob manually

What should you do when you’ve developed and installed a cron job for your Kubernetes application, and you need to test it? When writing classic cron jobs in Unix, it’s obvious how to test the job- just manually run the command specified in the... Read More | Share it now!

python终止线程

可以通过以下方式来终止线程: 通过抛出异常来终止进程 通过一个终止标志来终止进程 使用traces来终止进程 使用多线程模型来终止进程 通过将进程设置为deamon来终止进程 使用隐藏属性_stop() 通过抛出异常来终止进程 运行以上程序,一旦raise_exception()被调用,run()函数将被终止。这是因为程序抛出异常,将不在try…finally…函数块中运行,run()函数即被终止。 2.通过一个终止标志来终止进程 以上代码中,一旦全局变量stop_threads被置位,run()函数将终止,对应t1线程将因为t1.join()被终止。如果不使用全局变量,可以采用下面方式。 上面代码中传递的函数对象始终返回局部变量stop_threads的值。... Read More | Share it now!

python2 python3 hash() function

python2 的hash function是固定值 python3的hash function每次重启都不一样的值 用py27hash.hash 库来进行python2的hash。 ... Read More | Share it now!

htop

Most people familiar with Linux have used the top command line utility to see what process is taking the most CPU or memory. There’s a similar utility called htop that is much easier to use for normal tasks. The first great thing about htop... Read More | Share it now!