<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>AWS Lambda on Lin's Blog</title><link>http://coder.tw/tags/aws-lambda/</link><description>Recent content in AWS Lambda on Lin's Blog</description><generator>Hugo</generator><language>zh-tw</language><lastBuildDate>Thu, 08 Dec 2016 00:57:01 +0000</lastBuildDate><atom:link href="http://coder.tw/tags/aws-lambda/index.xml" rel="self" type="application/rss+xml"/><item><title>How to make elasticsearch.py Fast (Bulk Operate)</title><link>http://coder.tw/posts/how-to-make-elasticsearch-py-fast-bulk-operate/</link><pubDate>Thu, 08 Dec 2016 00:57:01 +0000</pubDate><guid>http://coder.tw/posts/how-to-make-elasticsearch-py-fast-bulk-operate/</guid><description>&lt;p&gt;用 Python 操作 Elasticsearch 時不免俗的肯定會安裝官方推出的 &lt;a href="https://elasticsearch-py.readthedocs.io/en/master/"&gt;elasticsearch.py&lt;/a&gt;，最近在用 Python 接收 Email Log 並寫入 Elasticsearch 時有蠻多心得可以分享的，大家都知道 AWS lambda 是用執行時間算錢的，所以在撰寫 AWS Lambda 時我可說是分秒必爭，看到執行超過 0.5 秒就各種吐血，所以從最開始的 .index 一筆一筆插入資料到 Elasticsearch，到後來用 streaming_bulk 處理，最後受不了用 parallel_bulk 混合 streaming_bulk 操作，以下就來聊聊這幾種方式的差異以及地雷吧！&lt;/p&gt;</description></item></channel></rss>