2018-09-03 Reading notes

Source: Internet
Author: User
Tags create index postgresql ticket

Recently this libertine re-out of the river, do not make friends lap, decided to start a good writing articles, everyone good watch studious!
Nearly half a year to collect a series of technology blog, intermittent in the small notebook wrote some notes, it is time to tidy up, to win the day more.

PostgreSQL Tuning Parameters

Original link
Absrtact: The default configuration of PostgreSQL does not have special optimizations for the application, but there are many parameters that are optimized for space, such as:

  1. Shared_buffer
    PostgreSQL has a level two cache, its own cache shared_buffer and the kernel cache. In order to be able to run on any rotten machine, the default value of Shared_buffer is very small. Adjusting the shared_buffer will be very effective. Recommended value is 25% of system memory

  2. Wal_buffers
    WAL = Write ahead log, pre-write logs, from Wiki:

    In a system that uses Wal, all of the changes are written to the log file before committing. The log file typically includes redo and undo information. Let's say that a program is in the process of performing certain operations in which the machine is out of power. At restart time, the program may need to know whether the action performed was successful or partially successful or failed. If Wal is used, the program can check the log file and compare what is planned to be done when the power is suddenly dropped. On the basis of this comparison, the program can decide whether to undo the actions that have been done or continue to do what has been done, or to remain as is.

    This buffer is available before these logs are written to disk, and can be adjusted if there are many concurrent connections

  3. Effective_cache_size
    Give PostgreSQL a disk caching estimate, if the actual can be used very large, but the estimated value is very small, then the performance will be lost

  4. Work_mem
    The amount of memory that can be used to sort in memories, and if query often has in memory sort, you can optimize

  5. Maintenance_work_mem
    Reserve to VACUUM, RESTORE, CREATE INDEX, ADD FOREIGN key,alter TABLE Such things as memory, tune up can optimize these tasks

  6. Synchronous_commit
    It is a performance trade-off, as mentioned in 2, whether all operations such as Wal,synchronous_commit are written into the WAL before the control commit.

  7. Checkpoint_timeout,checkpoint_completion_target
    Issue a checkpoint IO is expensive, and we want to be as short as possible smooth,checkpoint_timeout, checkpoint_completion_target if I understand correctly, try to be short.

The gains and losses of developing IOS with React Native

Original link
Advantage:

    1. The development efficiency is high, the Debug is easy. As with the development of the Web, the refresh is visible after the change, do not need to compile, Chrome F12 can be debugged
    2. Don't need much iOS knowledge, React's knowledge can be migrated.
    3. Flex box, a new CSS module:https://developer.mozilla.org/en-us/docs/learn/css/css_layout/flexbox very useful

Disadvantage:

    1. React Library Upgrade too fast, a lot of things break
    2. Because it's too new, a lot of the built-in features require support from a third-party library
    3. Some of the animated pits

Summary: It's worth it (no loss)!

Transformation of Twitch to Grpc frame

Original link
Structured RPC is good, the mouse station of the Tao friends before want to use GRPC, later found that there are problems, the reasons are as follows:

    1. HTTP 1.1 support is missing, GRPC only supports HTTP2, but there are many existing load balancer and the like only support HTTP 1.1
    2. The generated runtime is too large, and sometimes the old version of the client is incompatible with the new version of the server, it will break things (I strongly doubt that they are not open method wrong)
    3. Generated runtime too large, difficult to understand, there is a bug difficult to change
    4. GRPC only support binary payload, direct operation of binary is very inconvenient

Finally the mouse station with Golang built-in support HTTP 1.1 http Server,json, as well as PROTOBUF, re-wrote a system: TWIRP, implemented the following conventions:

    • The URL is /twirp/twitch.users.email.EmailBoss/UpdateEmail .
    • The HTTP Method POST is, because it's always POST .
    • The body of the message should be a protobuf UpdateEmailRequest .
    • The body should is encoded either in binary or in JSON.
    • The request should has a Content-type header set to either application/protobuf or application/json , matching the encoding of the body.
    • The response body is a protobuf UpdateEmailResponse , encoded in the same as the request.
    • If There is an error, it would be JSON encoded, including a message and a standardized error code.

Feelings: Sometimes a technology is good, but because infrastructure can not keep up, you may not be able to use ...

Uber uses NLP to help customer care ticket

Original link
With the development of Uber, the number of ticket is more difficult to handle manually, and Uber implements a simple and workable NLP approach

    1. For each user's ticket, extract features using SVD and TF-IDF
    2. Using cosine similarity to find the ticket of the first 3 approximation
    3. Return the recommended results to the customer service staff

Sentiment: Simple rough way, in fact, in the industry can meet a certain demand, do not need alchemy

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.