Skip to content

Instantly share code, notes, and snippets.

View juneng603's full-sized avatar

Junyoung Kim juneng603

  • Navercorp
  • Seoul, South Korea
View GitHub Profile
def find_optimal_equipment(N, U, D):
result = []
total_cost = 0
for i in range(N-1, -1, -1): # 역순으로 처리
# 사전순으로 가장 앞서는 선택을 먼저 고려
if total_cost + U[i] == 0:
result.append('+')
total_cost += U[i]
elif total_cost == 0:
"PIZ"
"Pix"
"Piz"
"god eat"
"godeat"
"hhfh"
"yhjj"
"가고야"
"간장게장"
"갈비"
@juneng603
juneng603 / kinesis_iterator.sh
Last active January 23, 2017 05:41
한줄짜리 kinesis stream iterator
streamname=SmartmenuStreamBeta; aws kinesis describe-stream --stream-name $streamname --output text | grep SHARDS | awk '{print $2}' | while read shard; do aws kinesis get-shard-iterator --stream-name $streamname --shard-id $shard --shard-iterator-type LATEST --output text | while read iterator; do while output=`aws kinesis get-records --shard-iterator $iterator --output text`; do iterator=`echo "$output" | head -n1 | awk '{print $2}'`; echo "$output" | gsed 1d | grep RECORDS | while read record; do echo $record | awk '{print $3}' | base64 -D; echo; done; done; done; done
@juneng603
juneng603 / gist:fbe692f2584cf4729c72
Last active August 29, 2015 14:20
필드 타입 이렇게 바꿀께요
5a6
>
18d18
< <vector name="site" type="bool" indexed="true"/>
21,22c21,22
< <vector name="imageCount" type="uint64"/>
< <vector name="videoCount" type="uint64"/>
---
> <vector name="imageCount" type="uint16"/>
> <vector name="videoCount" type="uint16"/>

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI
2013-07-25 18:29:16,859 ERROR org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics: Inconsistent configuration. Previous configuration for using table name in metrics: true, new configuration: false
2013-07-25 18:29:16,859 ERROR org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics: Inconsistent configuration. Previous configuration for using table name in metrics: true, new configuration: false
2013-07-25 18:29:16,859 ERROR org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics: Inconsistent configuration. Previous configuration for using table name in metrics: true, new configuration: false