Articles

  • MySQL Primer - Query Optimization

    Introduction

    This article describes query optimization.

    This article is intend for

    • Application Designer/Developer
    • Database/System Administrator
  • MySQL 性能调优分享

    摘要

    MySQL 凭借着开源社区和 Oracle 公司的支持,快速迭代变为很多公司关系型数据库的首选。

    本文着眼于 MySQL 的性能优化, 系统的介绍了性能优化的各个方面,从系统的选择,安装使用到性能测量,优化,末尾介绍了文档平台数据库优化过程中几个有代表性的例子。

    由于数据库优化设计内容众多,本文仅列出大纲,具体内容分布在对应的文章中。

  • Requests HTTP library for Python

    Table of Contents

    Make Requests

    JSON-Encoded POST/PATCH

    requests.post(url, data=json.dumps(payload))
    # or just pass to json parameter (v2.4.2+)
    requests.post(url, json=payload)
    

    Form-Encoded

    import requests
    
    r = requests.get('https://api.github.com/events')
    r = requests.post('https://api.github.com/post', data = {'key':'value'})
    r = requests.put('http://httpbin.org/put', data = {'key':'value'})
    r = requests.delete('http://httpbin.org/delete')
    r = requests.head('http://httpbin.org/get')
    r = requests.options('http://httpbin.org/get')
    
  • Setup Jekyll for Github Pages

    jekyll-github

    Introduction

    Jekyll is a simple static site generator that convert from Markdown source file to HTML pages. The result site is fast, portable and easy for servers like nginx to serve many users concurrently.

    Github Pages use jekyll to build site for user and repo pages. And the pages are hosted on github as a normal Git repository. So there is no differences between edit a source file and edit a post. The post is published when you push it to the upstream.

    This article introduces how to setup jekyll and the post-install steps like tweaks and adjustments.

  • Socket Programming - Advanced Topics

    Introduction

    This article covers some advanced topics about socket programming.

    setsockopt

    #include <sys/socket.h>
    int
    getsockopt(int socket, int level, int option_name,
        void *restrict option_value, socklen_t *restrict option_len);
    int
    setsockopt(int socket, int level, int option_name,
        const void *option_value, socklen_t option_len);
    

    getsockopt() and setsockopt() manipulate the options associated with a socket. Options may exist at multiple protocol levels; they are always present at the uppermost ``socket’’ level.

  • Performance Tuning

    Abstract

    Performance does not come without a price. And the optimization process is more like a journey finding the balance between cost, security and performance.

    After the system is up and running, there is something need to tweak according the workload to achieve better performance.

    You could use sysctl -w key=value or write to the proc fs, after that, validate the system behaves as you expected, if yes, then you may write the configuration to /etc/sysctl.conf

  • Performance Tuning - Networking

    Abstract

    This article is one of the performance tuning serias. This one is intended to introduce networking tuning.

  • ELK (Elasticsearch Logstash Kibana) Stack

    Introduction

    The ELK stack consists of Elasticsearch, Logstash, and Kibana.

    This article will walk you through the install and setup a working ELK stack. As well as some basic performance tuning.

    Elasticsearch Features at

    • Real-time data and real-time analytics
    • Scalable, high-availability, multi-tenant
    • Full text search
    • Document orientation
  • NTP Server (Network Time Protocol)

    NTP Server

    Introduction

    Setting your servers’s clock and timezone properly is essential in ensuring the healthy operation of distrubted systems and maintain accurate log timestamps. This article will show you how to install and configure the NTP time synchronization service on an Red Hat Enterprise Linux 7.2 Server.

  • DNS Server

    DNS Server

    Introduction

    DNS(Domain Name System) is a basic facility in the Internet as well as some intranets.

    This article will show you how to setup and configure the BIND DNS Server. The environment used is Red Hat Enterprise Linux 7. So this article also applies to Fedora and CentOS, meantime the procedure would be look alike on other releases.