2016-12-01から1ヶ月間の記事一覧

powerdns+dnsdistの構築

DNS

powerdns+dnsdistの構築 概要 もともとpdns(権威DNS)が動作していた環境にdnsdistを導入した。 以下のような構成。 + | 53/udp | +--------------+ | +----v-----+ | | | | | | | dnsdist | | | | | | | +----+-----+ | | | 10053/udp | +----v-----+ | | …

pylruをマルチスレッドで使うと「KeyError:」が発生する

githubにissueがないのでここに書く。 以下のような2スレッドで同時にlrucacheに書き込むとエラーが起きる。 test.py import pylru import threading import random cache = pylru.lrucache(1024) def f(): while True: key = 'key %s' % (random.randint(1,…