jreklund / php4dvd

php4dvd is an open source php/mysql powered movie database. Catalog your video collection with ease. Automatic update of information and images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement cache engine - fixing slow loading time

GoldMnaPro2014 opened this issue · comments

When the site has more than 30,000 films, it loads slowly, how to fix it?

Get a faster server I guess, this project don't have any caching engine.

Are you planning to add a caching system in the future?
And when to wait for the upgrade to version 4?

In version 3 no, it will be left as is. I will only update dependencies, fix bugs and security issues. At the moment there are no new planned additions, as it works as intended (for my use).

I currently have under 1k movies, and only tested it with 3k. 30k aren't really a personal website anymore, so I never tested that many.

Haven't written a single line of code, I'm busy contributing to other projects at the moment. So can't give any ETA on version 4. If the framework I choose have support for a caching, I can add it. Won't really write my own.

Any specific part that are slow? Have you limited the index page with "Results per page", or are you trying to load 30k titles at ones?

It would be nice to add caching mode

The output to the page I currently have 21 films per page.
When the site had 3K movies, the site loaded in 0.5-1 seconds, and when 30K, the site began to load in 4-10 seconds

That's probably because everything are stored as 1:1 in the database. There are no relation tables, so it grabs genres from 30 000 rows and format from 30 000 rows. Every time. This information are never cached.

Titles are at least limited, if you have limited "results per page". The only thing you can do it speed it up are to remove those from displaying.

In: /includes/movie.search.inc.php

// The movie categories
//$moviecategories = $moviedm->getCategories();
$Website->assign("categories", array());

// The movie formats
//$movieformats = $moviedm->getFormats();
$Website->assign("movieformats", array());

I tried everything, nothing works, how to fix this problem?
Can you implement caching?

I don't have 30k in my database, so I can't test it out. So did you try my suggestion and disabled categories and movie formats?
That are the only thing I can think about, except the obvious; Changing to a better server.

I have market caching for V4, as I don't have the need for it myself and it ain't a problem for normal users.

So did you try my suggestion and disabled categories and movie formats? - Yes
The question is, after about how long to wait V4?

Hi, then I'm afraid I can't give you any more help, as I don't have that big of a database to test on. Unless you are willing to dump it and send it to me. You can find my email on my website, on my github-profile in case you want to do that.

Version 4 status are still the same:

Haven't written a single line of code, I'm busy contributing to other projects at the moment. So can't give any ETA on version 4.

That's it, I sent you everything to the E-MAIL: hello@johaneklund.com

Hi, just took a quick look at it. And it's no longer a php4dvd system, I can't run it off the original code. The database itself dosen't match anymore. It's heavily modified with the homepage loading all directors, countries, casts, years and categories. All of those except years will have a heavy impact on your performance.

You are also loading movies in the sidebar and latest movies based on genres and that's will also slow you down. It wouldn't even matter if I cached categories and movieformats, it would still be slow to you. This requires a complete re-write of the database. You have also stripped away the license of said software, not cool man...