1665624754
RCProxy
Forked from https://github.com/wayslog/aster. Thanks!
======================
RCProxy is a lightweight, fast but powerful Redis Cluster Proxy written in Rust.
It supports memcache/redis singleton/redis cluster protocol all in one. RCProxy can proxy with two models:
cargo build --all --release
./target/release/rcproxy default.toml
sudo cp ./target/release/rcproxy /usr/local/bin/
sudo mkdir /etc/rcproxy
sudo cp default.toml /etc/rcproxy/
sudo mkdir /var/log/rcproxy
sudo cp service/systemd/rcproxy.service /lib/systemd/system/
sudo systemctl enable rcproxy
sudo systemctl start rcproxy
[log]
level = "libaster=info" # "trace" "debug" "info" "warn" "error"
ansi = true # support ANSI colors
stdout = false # print logs to stdout, not to log files
directory = "/var/log/rcproxy" # log file directory
file_name = "rcproxy.log" # log file name
[metrics]
port = 2110
[[clusters]]
# name of the cluster. Each cluster means one front-end port.
name="test-redis-cluster"
# listen_addr means the cluster font end serve address.
listen_addr="0.0.0.0:9001"
# cache_type only support memcache|redis|redis_cluster
cache_type="redis_cluster"
# servers means cache backend. support two format:
# for cache_type is memcache or redis, you can set it as:
#
# servers = [
# "127.0.0.1:7001:10 redis-1",
# "127.0.0.1:7002:10 redis-2",
# "127.0.0.1:7003:10 redis-3"]
#
# as you can see, the format is consisted with:
#
# "${addr}:hash_weight ${node_alias}"
#
# And, for redis_cluster you can set the item as:
#
# servers = ["127.0.0.1:7000", "127.0.0.1:7001"]
#
# which means the seed nodes to connect to redis cluster.
servers = ["127.0.0.1:7000", "127.0.0.1:7001", "127.0.0.1:7002", "127.0.0.1:7003", "127.0.0.1:7004", "127.0.0.1:7005"]
# Work thread number, it's suggested as the number of your cpu(hyper-thread) number.
thread = 1
# ReadTimeout is the socket read timeout which effects all in the socket in millisecond
read_timeout = 2000
# WriteTimeout is the socket write timeout which effects all in the socket in millisecond
write_timeout = 2000
############################# Cluster Mode Special #######################################################
# fetch means fetch interval for backend cluster to keep cluster info become newer.
# default 10 * 60 seconds
fetch = 600
# read_from_slave is the feature make slave balanced readed by client and ignore side effects.
read_from_slave = true
############################# Proxy Mode Special #######################################################
# ping_fail_limit means when ping fail reach the limit number, the node will be ejected from the cluster
# until the ping is ok in future.
# if ping_fali_limit == 0, means that close the ping eject feature.
ping_fail_limit=3
# ping_interval means the interval of each ping was send into backend node in millisecond.
ping_interval=10000
auth = "" # mypassw
see CHANGELOG.md
Author: clia
Source Code: https://github.com/clia/rcproxy
License: MIT license
1596679140
Redis offers two mechanisms for handling transactions – MULTI/EXEC based transactions and Lua scripts evaluation. Redis Lua scripting is the recommended approach and is fairly popular in usage.
Our Redis™ customers who have Lua scripts deployed often report this error – “BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE”. In this post, we will explain the Redis transactional property of scripts, what this error is about, and why we must be extra careful about it on Sentinel-managed systems that can failover.
Redis “transactions” aren’t really transactions as understood conventionally – in case of errors, there is no rollback of writes made by the script.
“Atomicity” of Redis scripts is guaranteed in the following manner:
It is highly recommended that the script complete within a time limit. Redis enforces this in a weak manner with the ‘lua-time-limit’ value. This is the maximum allowed time (in ms) that the script is allowed to run. The default value is 5 seconds. This is a really long time for CPU-bound activity (scripts have limited access and can’t run commands that access the disk).
However, the script is not killed when it executes beyond this time. Redis starts accepting client commands again, but responds to them with a BUSY error.
If you must kill the script at this point, there are two options available:
It is usually better to just wait for the script to complete its operation. The complete information on methods to kill the script execution and related behavior are available in the documentation.
#cloud #database #developer #high availability #howto #redis #scalegrid #lua-time-limit #redis diagram #redis master #redis scripts #redis sentinel #redis servers #redis transactions #sentinel-managed #server failures
1665624754
RCProxy
Forked from https://github.com/wayslog/aster. Thanks!
======================
RCProxy is a lightweight, fast but powerful Redis Cluster Proxy written in Rust.
It supports memcache/redis singleton/redis cluster protocol all in one. RCProxy can proxy with two models:
cargo build --all --release
./target/release/rcproxy default.toml
sudo cp ./target/release/rcproxy /usr/local/bin/
sudo mkdir /etc/rcproxy
sudo cp default.toml /etc/rcproxy/
sudo mkdir /var/log/rcproxy
sudo cp service/systemd/rcproxy.service /lib/systemd/system/
sudo systemctl enable rcproxy
sudo systemctl start rcproxy
[log]
level = "libaster=info" # "trace" "debug" "info" "warn" "error"
ansi = true # support ANSI colors
stdout = false # print logs to stdout, not to log files
directory = "/var/log/rcproxy" # log file directory
file_name = "rcproxy.log" # log file name
[metrics]
port = 2110
[[clusters]]
# name of the cluster. Each cluster means one front-end port.
name="test-redis-cluster"
# listen_addr means the cluster font end serve address.
listen_addr="0.0.0.0:9001"
# cache_type only support memcache|redis|redis_cluster
cache_type="redis_cluster"
# servers means cache backend. support two format:
# for cache_type is memcache or redis, you can set it as:
#
# servers = [
# "127.0.0.1:7001:10 redis-1",
# "127.0.0.1:7002:10 redis-2",
# "127.0.0.1:7003:10 redis-3"]
#
# as you can see, the format is consisted with:
#
# "${addr}:hash_weight ${node_alias}"
#
# And, for redis_cluster you can set the item as:
#
# servers = ["127.0.0.1:7000", "127.0.0.1:7001"]
#
# which means the seed nodes to connect to redis cluster.
servers = ["127.0.0.1:7000", "127.0.0.1:7001", "127.0.0.1:7002", "127.0.0.1:7003", "127.0.0.1:7004", "127.0.0.1:7005"]
# Work thread number, it's suggested as the number of your cpu(hyper-thread) number.
thread = 1
# ReadTimeout is the socket read timeout which effects all in the socket in millisecond
read_timeout = 2000
# WriteTimeout is the socket write timeout which effects all in the socket in millisecond
write_timeout = 2000
############################# Cluster Mode Special #######################################################
# fetch means fetch interval for backend cluster to keep cluster info become newer.
# default 10 * 60 seconds
fetch = 600
# read_from_slave is the feature make slave balanced readed by client and ignore side effects.
read_from_slave = true
############################# Proxy Mode Special #######################################################
# ping_fail_limit means when ping fail reach the limit number, the node will be ejected from the cluster
# until the ping is ok in future.
# if ping_fali_limit == 0, means that close the ping eject feature.
ping_fail_limit=3
# ping_interval means the interval of each ping was send into backend node in millisecond.
ping_interval=10000
auth = "" # mypassw
see CHANGELOG.md
Author: clia
Source Code: https://github.com/clia/rcproxy
License: MIT license
1643176207
Serde
*Serde is a framework for serializing and deserializing Rust data structures efficiently and generically.*
You may be looking for:
#[derive(Serialize, Deserialize)]
Click to show Cargo.toml. Run this code in the playground.
[dependencies]
# The core APIs, including the Serialize and Deserialize traits. Always
# required when using Serde. The "derive" feature is only required when
# using #[derive(Serialize, Deserialize)] to make Serde work with structs
# and enums defined in your crate.
serde = { version = "1.0", features = ["derive"] }
# Each data format lives in its own crate; the sample code below uses JSON
# but you may be using a different one.
serde_json = "1.0"
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize, Debug)]
struct Point {
x: i32,
y: i32,
}
fn main() {
let point = Point { x: 1, y: 2 };
// Convert the Point to a JSON string.
let serialized = serde_json::to_string(&point).unwrap();
// Prints serialized = {"x":1,"y":2}
println!("serialized = {}", serialized);
// Convert the JSON string back to a Point.
let deserialized: Point = serde_json::from_str(&serialized).unwrap();
// Prints deserialized = Point { x: 1, y: 2 }
println!("deserialized = {:?}", deserialized);
}
Serde is one of the most widely used Rust libraries so any place that Rustaceans congregate will be able to help you out. For chat, consider trying the #rust-questions or #rust-beginners channels of the unofficial community Discord (invite: https://discord.gg/rust-lang-community), the #rust-usage or #beginners channels of the official Rust Project Discord (invite: https://discord.gg/rust-lang), or the #general stream in Zulip. For asynchronous, consider the [rust] tag on StackOverflow, the /r/rust subreddit which has a pinned weekly easy questions post, or the Rust Discourse forum. It's acceptable to file a support issue in this repo but they tend not to get as many eyes as any of the above and may get closed without a response after some time.
Download Details:
Author: serde-rs
Source Code: https://github.com/serde-rs/serde
License: View license
1620885491
Hire top dedicated Mirosoft power BI consultants from ValueCoders who aim at leveraging their potential to address organizational challenges for large-scale data storage and seamless processing.
We have a team of dedicated power BI consultants who help start-ups, SMEs, and enterprises to analyse business data and get useful insights.
What are you waiting for? Contact us now!
No Freelancers, 100% Own Staff
Experienced Consultants
Continuous Monitoring
Lean Processes, Agile Mindset
Non-Disclosure Agreement
Up To 2X Less Time
##power bi service #power bi consultant #power bi consultants #power bi consulting #power bi developer #power bi development
1619670565
Hire our expert Power BI consultants to make the most out of your business data. Our power bi developers have deep knowledge in Microsoft Power BI data modeling, structuring, and analysis. 16+ Yrs exp | 2500+ Clients| 450+ Team
Visit Website - https://www.valuecoders.com/hire-developers/hire-power-bi-developer-consultants
#power bi service #power bi consultant #power bi consultants #power bi consulting #power bi developer #power bi consulting services