Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Inefficient MySQL Session Queries #548

@juanrossi

Description

@juanrossi

Hello, I've doing some load testing to the last version of CTF (ed0a225) and saw that some queries and the DB in general could be optimised.

The session table has the column cookie with type text. This is inefficient because we have a fixed size value that could fit inside a VARCHAR(200) without any issue. Also, the text type doesn't save values to memory, which generates lot of unnecessary CPU usage.

I know that on a normal usage, all this information would be also saved to Memcached, but I don't see why we can't also optimise this.

screen shot 2017-08-22 at 2 27 09 pm
This graph represents the CPU usage (With 100+ concurrent requests) after changing the type to varchar and adding an INDEX to cookie.

Also, I haven't seen any index besides the primary key ones or a UNIQUE key.

Would you be interested in a PR with improvements on the database schema?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions