sudo port unload postgresql12-server
sudo port load postgresql12-server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -u postgres pg_ctl -D /opt/local/var/db/postgresql12/defaultdb stop | |
sudo -u postgres pg_ctl -D /opt/local/var/db/postgresql12/defaultdb start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raw = Rails.cache.redis.get( Rails.cache.redis.keys.first) | |
Marshal.load raw | |
Marshal.load(raw).instance_variable_get :@value | |
Zlib::Inflate.inflate Marshal.load(raw).instance_variable_get :@value | |
Marshal.load Zlib::Inflate.inflate Marshal.load(raw).instance_variable_get :@value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
Socket.tcp("example.com", 443, connect_timeout: 1).close |
- runner does not use executor in <7, does use it in >=7
- console does not use executor in <7, not sure about >=7
- hello
- hello
- nested
- nested
- more
- more
- and again
puts "hello"
- and again
invoke with bin/jemalloc rails s
We weren’t using 3 before, but have been running 5 in prod for ~10 months now, we saw ~25% less memory usage compared to default malloc
see also https://gist.github.com/jjb/9ff0d3f622c8bbe904fe7a82e35152fc
For years, people have been using jemalloc with ruby. There were various benchmarks and discussions. Legend had it that Jemalloc 5 didn't work as well as Jemalloc 3.
Then, one day, hope appeared on the horizon. @wjordan offered a config for Jemalloc 5.
FROM ruby:3.1.2-bullseye
RUN apt-get update ; \
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
old=`pbpaste` | |
`echo '#{ENV['THE_TEXT']}' | pbcopy` | |
3.downto(0) do |second| | |
`osascript -e 'display notification "Reseting clipboard in #{second} seconds" with title "TMP Clipboard"'` | |
sleep 1 | |
end | |
`echo '#{old}' | pbcopy` |