DataTables Very Slow, Please Help!
DataTables Very Slow, Please Help!
powerongrfx
Posts: 5Questions: 0Answers: 0
I been having an issue with DataTables being slow on my website for about a year. Finally getting down to the issue but can't figure it out. DataTables is implanted with a plugin called WordPress Download Manager. I'm executing the tables with a short code on my page called browse which I offer for my registered members.
Sometimes it loads with no huge wait but most of the times the page takes 5 minutes to load or the website times out when you try to access the page with DataTables. The platform im using is WordPress and it's updated to the most current version. After speaking with WordPress Download Manager they pretty much said that its the DataTables and they can't do to much for me since it's not a error in there plugin.
I went ahead and found the .js file which lead me to this site since the copyrights was listed on the file. I found the FAQ and tried bSortClasses and bDeferRender but no luck the same thing. Im kinda at a standstill with my website since members complain about this issue since they can't access files using DataTables.
Im currently running a high end dedicated server thats blazing fast. What are my options? Can I hire a freelancer to do this for me?
Maybe server side processing my be the way? Really new to all of this spent two days straight reading on DataTables. I listed below the page where DataTables is located.
http://acapelladjs.com/browse-plus/
Sometimes it loads with no huge wait but most of the times the page takes 5 minutes to load or the website times out when you try to access the page with DataTables. The platform im using is WordPress and it's updated to the most current version. After speaking with WordPress Download Manager they pretty much said that its the DataTables and they can't do to much for me since it's not a error in there plugin.
I went ahead and found the .js file which lead me to this site since the copyrights was listed on the file. I found the FAQ and tried bSortClasses and bDeferRender but no luck the same thing. Im kinda at a standstill with my website since members complain about this issue since they can't access files using DataTables.
Im currently running a high end dedicated server thats blazing fast. What are my options? Can I hire a freelancer to do this for me?
Maybe server side processing my be the way? Really new to all of this spent two days straight reading on DataTables. I listed below the page where DataTables is located.
http://acapelladjs.com/browse-plus/
This discussion has been closed.
Replies
1. How many records (rows) are you trying to load?
2. server side processing could be the way forward.
3. Allan offers paid support: http://datatables.net/support
The YSlow browser plugin might be worth a shot.
1. There is about 2240 songs. It will continue to grow.
2. Im all for it as long no issues arise from this.
3. Is this to answer questions? Or he will actually edit DataTables and fix the issue?
@jan_goyvaerts
Points to the Datatables as the issue.
Once the page is actually up, the initialisation of DataTables appears to happen very quickly for me.
I'm not seeing 5 minutes load time in Chrome! Is it only in some browsers?
Allan
I had an issue with sluggish tables, albeit not this bad. One thing that helped was making sure that only plain text was returned from the sort and filter operations wherever possible. Datatables builds the search/filter array when loading the table and has to process everything. Plain text is much easier to process than lots of HTML or other elements, which have to be diced up and scrutinized.
You say it points to Datatables as the issue. If you haven't already, try using the full, non-minified version of Datatables, jQuery, etc (only for the test, of course!) and run those tools again. Chrome has great ones, but I myself am more familiar with Firefox. Firebug is handy for showing requests/responses and time taken on each, and FF has a good Javascript profiler that I found very helpful in finding specific bottlenecks in the code. Perhaps Datatables is the issue, but it's always helpful to know what piece or area is bogging down in Datatables.
Appreciate the quick response allan. Sometimes it loads up after 21 - 30 seconds. Other times for a bunch of users they claim that the page stays stuck in a loading loop. Regarding the minified version how do I go about doing this? You are correct once it loads up the datatables work perfect with no slow effects. The big issue is loading the page and getting to datatables.
Could be different browsers in Internet Explorer took about one minute. I'm using Google Chrome and those random issues from time to time as explained above.
Thank You,
Anthony
However - I just looked again (still Firefox) and got reasonable response time. I've never encountered anything in DataTables which could cause such inconsistency.
I'm no expert, but looking at "view page source" you seem to have a lot of complexity which might not all be necessary. Your basic application seems quite straightforward, but you're loading a lot of extras. And as Thefinaleofseem says, you don't really have a lot of data as databases go.
Allan
I currently have 5 columns at the moment. Im not sure regarding loading the song on the table. Could be but the rest of the website loads pretty fast. It's just this page with the Datatables being displayed that takes forever. Most users will just leave and assume its not working.
@tangerine
Thats what most users do they wait a minute and leave the page since it stays stuck in loading.
@allan
When I went to click on the page with Datatables it stood loading for about 1 - 2 minutes for me. During this time I went to server side and watch process manager. Shows the process of my website index.php and cpu% at 4.0 and after the page loaded the process went away. Also seems like after it loads once for a session on user side you can return to datatable page and it loads quick. It's the first load seems to be the big wait. Without this being processed my server load sits at Load Averages: 0.01 0.08 0.10
Thank you
They claim that it took 45 seconds to 1 minute and they ended up closing the browser since it look liked it did not work. So once they reopen they waited 15 seconds or so and it loaded up. Once it loaded up the datatables the first time loaded every time after that instantly.
Thanx
I've just tried it in Chrome with an empty cache ad the loading of the HTML for the page takes 51 seconds. That's nothing to do with DataTables, that's just transmission of data. The DOM ready event is firing about 1 minute 5 seconds after the initial page request - at that point DataTables can initialise the table, which it appears to do reasonably quickly (you could add a bit of Javascript to check exactly how fast).
However, as I say, DataTables can't actually do anything until the DOM is ready. And at 1 minute to load the page, folks are going to give up for certain!
Are you able to put up a copy of the page without DataTables on it?
What kind of connection is the server on? 50 seconds for 1.8MB of data is terrible! I'm on a 80MB/s downlink here and I seem to be getting around that at times, so I don't think it is my downlink, particularly as others are seeing a poor connection speed as well.
The other thing is that 1.8MB of data is a lot for an initial page load - certainly mobile users won't thank you for it! You should look at reducing that as much as you can. For example you have loads of repeating inline styles:
> Register!
Most of that is completely redundant! Just use a class and put the style into your CSS!! You should be able to get the table size well down below 1MB I would suggest.
Allan