Skip to content

Instantly share code, notes, and snippets.

View Gsantomaggio's full-sized avatar
🐒
Working from home

Gabriele Santomaggio Gsantomaggio

🐒
Working from home
View GitHub Profile
#!/usr/bin/env escript
%% -*- erlang -*-
main([String]) ->
try
File_env = String++"/_rm_env",
file:delete(File_env),
file:write_file(File_env, "export RABBITMQ_PID_FILE="++String++"/data/rmq.pid\n", [append]),
file:write_file(File_env, "export RABBITMQ_BASE="++String++"\n", [append]),
file:write_file(File_env, "export RABBITMQ_LOG_BASE="++String++"/data/logs\n", [append]),
file:write_file(File_env, "export RABBITMQ_MNESIA_BASE="++String++"/data/db\n", [append]),
apt-get update &&
apt-get -y install wget &&
apt-get -y install nano &&
echo "deb http://packages.erlang-solutions.com/debian jessie contrib" >> /etc/apt/sources.list &&
wget http://packages.erlang-solutions.com/debian/erlang_solutions.asc &&
apt-key add erlang_solutions.asc &&
apt-get -y update &&
apt-get -y install erlang &&
apt-get -y install git &&
apt-get -y install make &&
__author__ = 'gabriele'
import urllib2
import base64
import time
import datetime
import json
def print_time(step):
#!/bin/bash
IFS=$'\n'
ordered_vhosts=$(./rabbitmqctl list_vhosts -q | xargs -n1 | sort -u)
for V in $ordered_vhosts; do
echo "*****Vhost $V Total queues " $(./rabbitmqctl list_queues -q -p $V | wc -l)
for Q in $(./rabbitmqctl list_queues -q name messages -p $V | xargs -n2 | sort -u); do
echo "Vhost $V queue-name total-messages $Q"
done
done
wget http://ftp.tu-chemnitz.de/pub/linux/dag/redhat/el6/en/x86_64/rpmforge/RPMS/socat-1.7.1.3-1.el6.rf.x86_64.rpm
sudo yum install socat-1.7.1.3-1.el6.rf.x86_64.rpm
#set -g default-terminal "rxvt-unicode-256color"
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi

RabbitMQ test with different libraries

I made a few tests with different client libraries.

Environment:

  • Laptop 12 cores, 32 gb ram
  • Two rabbitmq nodes in cluster ( same machine)
  • RabbitMQ version 3.7.13 - Erlang 21.2.4
  • 64 async threads for each server
  • Ubuntu 18.04
@Gsantomaggio
Gsantomaggio / mandatory.md
Last active May 28, 2019 09:48
mandatory

Basic Idea

The idea is to add another parameter to the function RPCCLient as:

client = oslo_messaging.RPCClient(transport, target, options={'mandatory': True})
client.call({}, 'foo', id_value=str(i), test_value="hello oslo")

Inside the function, _publish decode the option value, as:

#!/bin/zsh
printf "%dGi/32Gi" $(cat /proc/meminfo | awk '{print $2}' | head -n 2 | tail -n 1)/1024/1024
Last Name First Name Email Address Password Org Unit Path Change Password at Next Sign-In
Bianchi Mario mario.bianchi@icxxxxx.istruzioneer.it password1 /Studenti/Studenti Elementari/Prima A TRUE
Rossi Rossella rossella.rossi@icxxxxx.istruzioneer.it password1 /Studenti/Studenti Elementari/Prima A TRUE
Verdi Silvia silvia.verdi@icxxxxx.istruzioneer.it password1 /Studenti/Studenti Elementari/Prima B TRUE
Gialli Ali ali.gialli@icxxxxx.istruzioneer.it password1 /Studenti/Studenti Elementari/Prima B TRUE
Neri Marco marco.neri@icxxxxx.istruzioneer.it password1 /Studenti/Studenti Elementari/Prima C TRUE
Marroni Anna anna.marroni@icxxxxx.istruzioneer.it password1 /Studenti/Studenti Elementari/Prima C TRUE