What I learned by participating in the ISUCON10 qualifying

I participated in ISUCON10

I joined Isucon10 as a good luck power-in team with my colleague ToshihitoKon. The origin of the name is the inner ring material that was popular in the company for a while w

In the first year of my new graduate last year, I was too busy to participate, so I was able to afford a little in the second year and I will participate this year! So I tried to participate in the war. The first ISUCON!

We have a legend who has won the ISUCON several times and has questions, but if possible, I would like to team up with members of the same level to know my position, so I decided to use Toshihito Kon as a team member. I invited you. I had a lot of opportunities to work together, so in that sense it was easy to communicate and it was fun.

ToshihitoKon had a strong infrastructure, so I asked for the infrastructure, and I proceeded with the division of roles devoted to the application. The language used is Go.

Until the day

I tuned the ISUCON9 qualifying by running it on my Mac's local docker. http://isucon.net/archives/53805209.html

I also looked at the blogs that gave high scores in the past and used the strategy as a reference. https://to-hutohu.com/2019/09/09/isucon9-qual/#%E5%BD%93%E6%97%A5

As a result, I thought that I was not very familiar with how to use ʻalp pt-query-digest`` Nginx`, so I tried to analyze the access log and slow query log based on the ISUCON9 qualifying. I was doing it.

After that, the standard Make a competition, prepare the git repository in advance, and so on.

Personally, I didn't understand Nginx enough, so I read through the following books. It was very helpful. Introduction to nginx practice WEB + DB PRESS plus nginx

In the past questions of Isucon9 qualifying, I was able to get close to 10,000 points at hand, so I decided to go to the day. I stayed at Toshihito Kon's house the day before and had a pizza party, and I was able to enjoy it like a festival lol

On the day

ToshihitoKon was able to finish the infrastructure settings smoothly, so I was able to concentrate on tuning the app. ToshihitoKon will take care of DB settings and multiple device configurations, and tune the app.

--Reading the regulations carefully --For the time being, I decided to write a regular expression on the Nginx side to repel the bot ――I was very happy that the results of Nginx's studies came out immediately. --After that, read the DB structure and application to understand the whole ――I was surprised that the application and DB were very simple. The competition has progressed because it is a mechanism that allows you to concentrate on the problem! ――I just stared at the log and put an index, and identified a slow endpoint. ――By all means, the search for chairs and real estate is slow. --I tried to put the index for the time being --In many cases, the index could not be pasted as it was, so try changing the application, etc. --I tried to change the order by on the DB side to sort by myself

I got a score of about 650 around here, but it has been sluggish since then ... Looking at other teams, it seemed that we had to eliminate the critical bottleneck.

I thought that there were two options, tracing to speed up the search or on-memory cache, so I tried the on-memory cache that I had studied in advance, but I could not completely eliminate the bugs and could not introduce it. ... I'm sorry!

As a result, I finished with about 650 points.

Try to participate

Read the commentary

http://isucon.net/archives/55025156.html Looking at the comments, I thought it was important to try to speed up the search by tracing.

Also, I could only think of a strategy to implement the search on the application side by making the place where the search is complicated into an on-memory cache, but there was also a way to put an index on all the search conditions normally.

index I thought it was not good to put it in the dark clouds, but I should have tried it once before making a decision. Don't just guess, measure it.

Also, I knew the problem that the index did not work due to sorting in descending order and ascending order, but it is very much better to add a new column to deal with this! have become.

I also noticed that the bulk insert speed was increased, but I didn't access it as much as I saw the log, so I left it. Perhaps once the bottleneck is resolved, that will become a problem next.

Learn

When I usually work, I have a lot of work that is closer to applications, and I didn't have to write Nginx settings from scratch, so I feel that it was very good that I gained a lot of knowledge about infrastructure by participating in ISUCON. I will!

Also, in my current job, I spend an overwhelming amount of time reading code and thinking about designs based on existing specifications, and I regret that I lack the ability to move my hands and write code **. ..

Even after reading the commentary, it seemed that the bottleneck was identified quite well, so ISUCON clearly felt the lack of implementation power of "how to solve it". Increase the chances of writing code not only in your daily work but also in your private life! It led to the motivation.

Finally

Thank you to all the operators for the fun issues! !! I was very impressed with the skill set and attitude of everyone who manages this level of questions and tournaments. I want to devote myself so that I can do that one day. Thanks to Toshihito Kon for joining us again! Like revenge next year!

Recommended Posts

What I learned by participating in the ISUCON10 qualifying
I participated in the ISUCON10 qualifying!
What I learned in Python
What I learned by writing a Python Pull Request for the first time in my life
Participated in the first ISUCON with the team "Lunch" # ISUCON10 Qualifying
What I learned about Linux
What I learned by solving 30 questions of python Project Euler
What beginners learned from the basics of variables in python
What I saw by analyzing the data of the engineer market
I got lost in the maze
The story of participating in AtCoder
Use the vector learned by word2vec in the Embedding layer of LSTM
I learned about processes in Python
I wrote the queue in Python
What I have learned in the past year as an elderly person (unsuitable for my age)
I wrote the stack in Python
What I learned in two months before the product was released as a machine learning fucking amateur
I want to change the color by clicking the scatter point in matplotlib
I tried fractal dimension analysis by the box count method in 3D
I can't find the commands in the package introduced by pip from Emacs
What is "mahjong" in the Python library? ??
Read the file line by line in Python
I saved the scraped data in CSV!
Read the file line by line in Python
I wrote the selection sort in C
I can't get the element in Selenium!
What I learned at hackerrank on 1/30 days.
I wrote the sliding wing in creation.
What I learned by implementing how to create a Default Box for SSD
What I did when I got stuck in the time limit with lambda python
I tried to predict the change in snowfall for 2 years by machine learning
What I found by deploying Django on EC2
What is wheezy in the Docker Python image?
I tried simulating the "birthday paradox" in Python
I tried the least squares method in Python
I can't enter characters in the text area! ?? !! ?? !! !! ??
I tried using the Datetime module by Python
I wrote the hexagonal architecture in go language
I implemented the inverse gamma function in python
Search by the value of the instance in the list
What should I do with DICOM in MPEG2?
[Question] What happens when I use% in python?
I checked the calendar deleted in Qiita Advent Calendar 2016
I implemented Human In The Loop ― Part ① Dashboard ―
I want to display the progress in Python!
[Linux] I learned LPIC lv1 in 10 days and tried to understand the mechanism of Linux.
What I thought about in the entrance exam question of "Bayesian statistics from the basics"
What I did when I was angry to put it in with the enable-shared option