ACDB ACDB Logo KonataLog In Search
Random
Collections
Bookmarks
Light/Dark Theme
Site Map
Ads
more speed Aug 2, 2011 | Rei
Noticed today a lot of the Character and Anime view counters were slowing down the site.

Especially when new characters are added, it can take an average of 1 second to rebuild the indexes. A lot of the errors tho were for cases taking around 10 seconds to complete.

While I would like to code an extendable database framework in C, it's a project that should take upwards of a week, and one I'd like to do concurrently with a Binary Tree module ... which I still lack.

Anyways, the Views are expendable. They generate themselves, after all. THat's why I can code a risky replacement which could lose all data. And it's why I can change the storage engine from InnoDB to memory. I had tried different indexes, but it was kinda like an idiot pressing all the buttons on a remote to change the channel. I did more harm than good. The memory storage engine should never take more than a second to complete any operation of this fixed data set. Even without proper indexes.


And another update on the stats server memory usage.

Seems to have stabilized now.

73375 rei 1 45 1 19112K 15608K accept 1 113:36 0.00% ss

19MB max allocated, and 15MB in use. Not bad at all.


Hopefully later this month I can start on the next version of the Stats Server.

Feature requests include:
- Binary Tree Indexes
- export to disk
- load from file
- dynamic table frameworks
Character Comments Jul 31, 2011 | Rei
Updated the Character Comments Presentation:

http://www.animecharactersdatabase.com/charactercomments.php

We had been using a DL DT DD style of comment I borrowed from TPB. In the end, it kinda sucked. Fun using a seldom used HTML 4.01 element tho.
books Jul 30, 2011 | Rei
Started work on the Guide Books project.

It's something fun and easy, but led off on a difficult tangent.

This is roughly the 500th time I've created an HTML table. And likely the 300th time I'll write handlers for FORM data. Seems like as good a time as any to analyze all of them, find the similarities, and write a dynamic generation application to cut down on the duplication.

So working on that...


Another memory usage update on the session server.
73375 rei 1 45 1 19112K 15596K accept 3 72:23 0.00% ss

It's nearing 20MB of allocated heap. Wonder when/where it'll hold. 27M to 30M might not be so bad.

I've also been optimizing various MySQL queries, correcting table definitions from back when I was still a Noob. Removing useless indexes, and adding crucial JOIN indexes. Plus completely rewriting some queries so they examine less data and execute more quickly.



mysql> explain SELECT COUNT(*) AS n FROM (SELECT author,COUNT(*) AS n FROM characters GROUP BY author) AS a WHERE n > 10;
+----+-------------+------------+------+---------------+------+---------+------+-------+---------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+------------+------+---------------+------+---------+------+-------+---------------------------------+
| 1 | PRIMARY | | ALL | NULL | NULL | NULL | NULL | 326 | Using where |
| 2 | DERIVED | characters | ALL | NULL | NULL | NULL | NULL | 25895 | Using temporary; Using filesort |
+----+-------------+------------+------+---------------+------+---------+------+-------+---------------------------------+
2 rows in set (0.02 sec)

mysql> create index author on characters(author);
Query OK, 25895 rows affected (0.80 sec)
Records: 25895 Duplicates: 0 Warnings: 0

mysql> explain SELECT COUNT(*) AS n FROM (SELECT author,COUNT(*) AS n FROM characters GROUP BY author) AS a WHERE n > 10;
+----+-------------+------------+-------+---------------+--------+---------+------+-------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+------------+-------+---------------+--------+---------+------+-------+-------------+
| 1 | PRIMARY | | ALL | NULL | NULL | NULL | NULL | 326 | Using where |
| 2 | DERIVED | characters | index | NULL | author | 4 | NULL | 25895 | Using index |
+----+-------------+------------+-------+---------------+--------+---------+------+-------+-------------+
2 rows in set (0.01 sec)


TOP Go Top

view bookmarks
This site uses cookies for analytics, personalized content and ads. By continuing to browse this site, you agree to this use. Learn more [close]

Who Board | New Thread

Yesterday 11:46 pm
Anonymous
Who is this ?
Ads
All images are copyright of their respective owners. Copyright © Goral Software