Skip to content

Instantly share code, notes, and snippets.

View ycku's full-sized avatar
😈
Be evil

Yung-Chung Ku ycku

😈
Be evil
View GitHub Profile
without PgBouncer with PgBouncer
including excluding overhead including excluding overhead
50 279.45 470.49 40.60% 651.29 752.88 13.49%
100 300.56 519.99 42.20% 688.09 794.18 13.36%
200 fail fail 728.26 826.52 11.89%
300 fail fail 808.12 923.31 12.48%
400 fail fail 797.75 898.38 11.20%
500 fail fail 744.53 824.08 9.65%
600 fail fail 808.09 884.52 8.64%
@ycku
ycku / apt-offline.md
Last active April 22, 2025 06:48
記錄 apt-offline 的標準語法,在離線環境使用 apt

Advantages

  1. 相容原有的 source list
  2. 只下載需要安裝的套件
  3. 步驟單純

Goals

基本上就是處理下面三種(apt update, upgrade, install)需要網路的操作

  • online$: 表示在有對外網路的主機操作
  • offline$: 表示在無對外網路的主機操作
@ycku
ycku / pip-offline.md
Last active June 11, 2020 06:47
Note: Offline python pip install

Online host

  • Try to install 'pyvmomi' module
$ mkdir pyvmomi
$ cd pyvmomi
$ pip download pyvmomi
  • Now the related modules of 'pyvmomi' are downloaded in the folder.
@ycku
ycku / pgbench-alpine-debian.md
Last active December 12, 2018 08:01
測試 Docker 使用 alpine 和 debian 的效能
1 2 3 4 5 6 7 8 9 10
Alpine 1017.10 1078.33 1006.94 1013.67 987.46 999.53 988.34 1024.07 989.77 930.69
Debian Stretch 935.02 986.09 935.33 961.89 934.99 970.06 977.44 968.70 902.98 893.98
平均 標準差 誤差 比值
Alpine 1003.59 36.99 3.69% 106.01
Debian Stretch 946.65 31.36 3.31% 100.00
1 2 3 4 5 平均 標準差 誤差 比值
A 951.99 979.08 992.40 1067.75 1014.78 1001.20 43.59 4.35% 100
B 888.62 944.81 901.56 944.71 920.34 920.01 25.25 2.74% 91.89
@ycku
ycku / install-docker.sh
Created November 4, 2017 13:57
Docker Installation
#!/bin/bash
# Please check out the details of official page: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
# Tested on Ubuntu Zesty 17.04 amd64
# This script need to sudo.
sudo -S sudo -v
# Uninstall old versions
sudo apt-get remove docker docker-engine docker.io
@ycku
ycku / data-type.py
Last active September 5, 2017 03:16
Hello, Python
# 執行時自行註解掉不需要的段落
# 自動型別
var = 'Hello World' # string
print(var)
var = 100 # int
print(var+10)
print('-----')
# 沒有 overflow