Jump to content

[BF4] Stats webpage for XpKiller's Stats Logger Plugin


tyger07

Recommended Posts

Originally Posted by ColColonCleaner*:

 

I will be thinking about this...

I am still a little puzzled while adding up the numbers and comparing costs and benefits. If fetching 20 rows takes 4 times longer, it makes me wonder if the hassle and inconvenience (to both me and the user) of overhauling the pagination design is worth it for very little comparable gain. What is a 20 second load time compared to 25 second load time? Both are awful numbers and feel awful for the user. Is it worth hampering the functionality for the user who will be less than impressed by the load time either way?

The thing is...other web services who offer chat logging have almost instant response for searches using substrings of messages. So what are they doing differently?

 

Perhaps a rethink of how this is working from a design standpoint would help.

* Restored post. It could be that the author is no longer active.
Link to comment
  • Replies 1.7k
  • Created
  • Last Reply

Originally Posted by Jamesonp*:

 

I really appreciate your work and it looks great but there are some fatal flaws with the latest version. We're going to be working on it on our end at some point to try and make it efficient.

 

An example of a fatal flaw - I've caused my MySQL instance to run out of memory using over 8GB of RAM and start swapping which causes MySQL to become defunct and fail when clicking links quickly.

 

I'm sure I'm not the only one with a database that's super large and won't be the last. I'm just not willing to give up stats and trim my database that we use on the administration side for player management.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ColColonCleaner*:

 

There has to be a better way of storing these.

 

The tblchatlog table is stored using InnoDB, which has terrible performance for parsing full text messages, especially in large quantity.

 

MyISAM, although less functional, provides much higher performance when searching full text messages, so player names and their chat logs.

 

Has anyone tried converting their chatlog tables over to see if any performance benefits can be found?

 

EDIT: I know foreign key constraints do not work with MyISAM. They can be added, but they will not be enforced, so this shouldn't cause any issues as long as all the interacting scripts handle their inserts correctly.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Prophet731*:

 

There has to be a better way of storing these.

 

The tblchatlog table is stored using InnoDB, which has terrible performance for parsing full text messages, especially in large quantity.

 

MyISAM, although less functional, provides much higher performance when searching full text messages, so player names and their chat logs.

 

Has anyone tried converting their chatlog tables over to see if any performance benefits can be found?

 

EDIT: I know foreign key constraints do not work with MyISAM. They can be added, but they will not be enforced, so this shouldn't cause any issues as long as all the interacting scripts handle their inserts correctly.

Remember the read and write locks with MyISAM. If the chatlog table is being written too you cant do a select on it at the same time so it will add delay to that. With multiple servers writing to it a lot it will cause delays in the query.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Prophet731*:

 

I will be thinking about this...

I am still a little puzzled while adding up the numbers and comparing costs and benefits. If fetching 20 rows takes 4 times longer, it makes me wonder if the hassle and inconvenience (to both me and the user) of overhauling the pagination design is worth it for very little comparable gain. What is a 20 second load time compared to 25 second load time? Both are awful numbers and feel awful for the user. Is it worth hampering the functionality for the user who will be less than impressed by the load time either way?

Try a simple pagination with just Previous and Next options. That's how I do it for my chatlog searching thanks to laravels pagination simple function. :smile:

 

This is my controller which handles the chat log searching page. I need to overhaul it and make it to where it's not server specific and clean it up. I wrote it very messy.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Jamesonp*:

 

There has to be a better way of storing these.

 

The tblchatlog table is stored using InnoDB, which has terrible performance for parsing full text messages, especially in large quantity.

I wonder if altering the column to use VARCHAR(100) would be a more viable option. I've seen mixed statements on whether text and varchar are treated the same with INNODB.

 

I doubt MyISAM would be a good choice for this table due to the lock limitations.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Prophet731*:

 

I wonder if altering the column to use VARCHAR(100) would be a more viable option. I've seen mixed statements on whether text and varchar are treated the same with INNODB.

 

I doubt MyISAM would be a good choice for this table due to the lock limitations.

Altering the column wouldn't do anything. It's just the indexing that's the problem otherwise it would better with search actual messages.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Jamesonp*:

 

Altering the column wouldn't do anything. It's just the indexing that's the problem otherwise it would better with search actual messages.

Well the only reason why I brought that up was because with MyISAM a text column is scanned each time due to not being allowed in memory vs varchar which is. I'm just not 100% sure that's the case with InnoDB.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Prophet731*:

 

Well the only reason why I brought that up was because with MyISAM a text column is scanned each time due to not being allowed in memory vs varchar which is. I'm just not 100% sure that's the case with InnoDB.

Something like Elasticsearch would be awesome to implement. Problem is it more difficult to setup and configure and what not. I wanted to set this up for ADK to improve the chat log search ability but it requires a bit more then just an slap slap connect and go. I might find a use for it someday.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Prophet731*:

 

That's the first I've ever heard of Elasticsearch and it looks pretty amazing. I was just thinking of using something like memcached to see what that'd do for me.

Memcached wouldn't really be used for something like that. Run out of memory pretty quickly on larger DB I would assume.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Jamesonp*:

 

Memcached wouldn't really be used for something like that. Run out of memory pretty quickly on larger DB I would assume.

You're probably right. Still might be worth a try. Maybe I'll spin up a Google Compute Engine instance and see.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

I really appreciate your work and it looks great but there are some fatal flaws with the latest version. We're going to be working on it on our end at some point to try and make it efficient.

 

An example of a fatal flaw - I've caused my MySQL instance to run out of memory using over 8GB of RAM and start swapping which causes MySQL to become defunct and fail when clicking links quickly.

 

I'm sure I'm not the only one with a database that's super large and won't be the last. I'm just not willing to give up stats and trim my database that we use on the administration side for player management.

What do you want me to say?

 

Before:

https://github.com/tyger07/BF4-Serve...ommon/chat.php

 

After:

https://github.com/tyger07/BF4-Serve...ommon/chat.php

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Try a simple pagination with just Previous and Next options. That's how I do it for my chatlog searching thanks to laravels pagination simple function. :smile:

 

This is my controller which handles the chat log searching page. I need to overhaul it and make it to where it's not server specific and clean it up. I wrote it very messy.

Jamesonp suggested the same.

 

The problem though is that the pagination code wasn't his issue. His issue was with selecting 20 rows of data from any location. How can I fix that issue other than try to help him ban the 40 bots from his site which were overloading his database? Did you ever take a look at how many users were viewing his stats pages at any one time? It was insane. I am assuming that the text box and easier navigation were a bots dream and they were going ballistic with it.

 

I have not changed the pagination code itself ever; the only thing which changed was its appearance. So for Jamesonp to make such a claim... well whatever.

 

I totally agree that I could optimize it by making the pagination more simple. But the loss in usability seems like a steep cost in favor of a page which loads in 4 seconds instead of 5 seconds (in Jamesonp's case). Both are slow load times and the pagination and query are obviously not the root causes.

 

Assuming that bots were the root cause since nothing else changed, I would have to assume that increasing the text length required before a jquery is fired off and adding a delay between text input and jquery refresh would be a big performance boost. As it is, it will fire off a new query as each letter is entered (to filter down the results real-time) which causes a rapid-fire succession of queries.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Prophet731*:

 

Jamesonp suggested the same.

 

The problem though is that the pagination code wasn't his issue. His issue was with selecting 20 rows of data from any location. How can I fix that issue other than try to help him ban the 40 bots from his site which were overloading his database? Did you ever take a look at how many users were viewing his stats pages at any one time? It was insane. I am assuming that the text box and easier navigation were a bots dream and they were going ballistic with it.

 

I have not changed the pagination code itself ever; the only thing which changed was its appearance. So for Jamesonp to make such a claim... well whatever.

Are the bots ones by search engines or people hitting his site in an attempt to bottleneck it?

 

I was also suggesting the simple paginate as it would make the SQL query a little quicker without having to generating the page numbers on large searches.

 

You could implement a throttle limit so like most forums have on the search engine. I need to do this for player searching and a few other places in my code.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Are the bots ones by search engines or people hitting his site in an attempt to bottleneck it?

 

I was also suggesting the simple paginate as it would make the SQL query a little quicker without having to generating the page numbers on large searches.

 

You could implement a throttle limit so like most forums have on the search engine. I need to do this for player searching and a few other places in my code.

I don't know which bots he had searching through the stats pages. But it seemed obvious that he must have some bots from somewhere. It just isn't very likely that he had such a demand for stats from his players to cause there to always be 40 to 50 players searching his stats pages. Usually bots are from search engines; but it could also be nefarious attempts to find security flaws, misguided brute-force attacks (misguided since there is nothing to gain), or DDoS attempts.

 

Taken from edit above:

 

"Assuming that bots were the root cause since nothing else changed, I would have to assume that increasing the text length required before a jquery is fired off and adding a delay between text input and jquery refresh would be a big performance boost. As it is, it will fire off a new query as each letter is entered (to filter down the results real-time) which causes a rapid-fire succession of queries."

 

Perhaps I should just remove the nice-looking real-time jquery search completely. Or, like you said, make a limit per user of X number of searches in Y number of seconds.

 

Whatever the source of the load, it seems to me that the excessive load on the database is what caused his performance issues rather than the queries themselves.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Prophet731*:

 

Is it possible to hide the inactive servers on the index page?

 

In tbl_server connectionState is set to off, maybe use that as a way to hide them? :smile:

Well I change those values. The plugin, as far as I know, doesn't touch that column. Ty would need to add a interface to change that column.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ColColonCleaner*:

 

Well I change those values. The plugin, as far as I know, doesn't touch that column. Ty would need to add a interface to change that column.

Or we could add a last-online column that's automatically updated on row change, and use that to manage offline servers.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Prophet731*:

 

Or we could add a last-online column that's automatically updated on row change, and use that to manage offline servers.

So what if procon goes offline but the server is still running?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by TMiland*:

 

Well I change those values. The plugin, as far as I know, doesn't touch that column. Ty would need to add a interface to change that column.

I was just thinking, that if it was set to offline, hide it from the index here: http://nbfc.no/bf4stats/ :tongue:

 

I have only 2 active servers now...

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Update released!

 

Changes:

- Block common bots

- Faster combined player counts on a few pages

- Added filter to not display servers if there `ConnectionState` is NOT NULL in the `tbl_server` table

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

That was the idea, that's great. :smile:

Hmm.

 

My update above was too hurried. On the surface, it does exactly what you want. The issue is that most of the data from the other servers will still be counted in the combined server stats pages.

 

I will need to add conditions like I did on the chat and maps page such as "WHERE `ServerID` in ({$ids})".

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by TMiland*:

 

Hmm.

 

My update above was too hurried. On the surface, it does exactly what you want. The issue is that most of the data from the other servers will still be counted in the combined server stats pages.

 

I will need to add conditions like I did on the chat and maps page such as "WHERE `ServerID` in ({$ids})".

Did a git pull now, and i get "No 'BF4' servers were found in this database! Please notify this website's administrator."

 

Edit:

You need to do: Code:

AND `ConnectionState` = 'on'
Works: nbfc.no/bf4stats/ :smile:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Jamesonp*:

 

Jamesonp suggested the same.

 

The problem though is that the pagination code wasn't his issue. His issue was with selecting 20 rows of data from any location. How can I fix that issue other than try to help him ban the 40 bots from his site which were overloading his database? Did you ever take a look at how many users were viewing his stats pages at any one time? It was insane. I am assuming that the text box and easier navigation were a bots dream and they were going ballistic with it.

 

I have not changed the pagination code itself ever; the only thing which changed was its appearance. So for Jamesonp to make such a claim... well whatever.

 

I totally agree that I could optimize it by making the pagination more simple. But the loss in usability seems like a steep cost in favor of a page which loads in 4 seconds instead of 5 seconds (in Jamesonp's case). Both are slow load times and the pagination and query are obviously not the root causes.

 

Assuming that bots were the root cause since nothing else changed, I would have to assume that increasing the text length required before a jquery is fired off and adding a delay between text input and jquery refresh would be a big performance boost. As it is, it will fire off a new query as each letter is entered (to filter down the results real-time) which causes a rapid-fire succession of queries.

Yea they weren't bots, the user I use for the stats pages is strictly set to select only. Those page view stats are completely wrong and from when I first setup the stats logging page.

 

Literally when I watched top on my VDS I could tell when someone was browsing the stats page because the MySQL process would pop to the top with 100% CPU usage and then fall back down when the page was done being generated.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Did a git pull now, and i get "No 'BF4' servers were found in this database! Please notify this website's administrator."

What are the ConnectStates for your server is tbl_server? My database shows the defult connection state is NULL, so I filtered it to only find servers with that default state. Is your default state different or have you changed the connection state values for your servers?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by TMiland*:

 

What are the ConnectStates for your server is tbl_server? My database shows the defult connection state is NULL, so I filtered it to only find servers with that default state. Is your default state different or have you changed the connection state values for your servers?

They are changed by the adkats webadmin panel, either off or on. Looks like this: Posted Image

 

Posted Image

* Restored post. It could be that the author is no longer active.
Link to comment

Archived

This topic is now archived and is closed to further replies.




  • Our picks

    • Game Server Hosting:

      We're happy to announce that EZRCON will branch out into the game server provider scene. This is a big step for us so please having patience if something doesn't go right in this area. Now, what makes us different compared to other providers? Well, we're going with the idea of having a scaleable server hosting and providing more control in how you set up your server. For example, in Minecraft, you have the ability to control how many CPU cores you wish your server to have access to, how much RAM you want to use, how much disk space you want to use. This type of control can't be offered in a single service package so you're able to configure a custom package the way you want it.

      You can see all the available games here. Currently, we have the following games available.

      Valheim (From $1.50 USD)


      Rust (From $3.20 USD)


      Minecraft (Basic) (From $4.00 USD)


      Call of Duty 4X (From $7.00 USD)


      OpenTTD (From $4.00 USD)


      Squad (From $9.00 USD)


      Insurgency: Sandstorm (From $6.40 USD)


      Changes to US-East:

      Starting in January 2022, we will be moving to a different provider that has better support, better infrastructure, and better connectivity. We've noticed that the connection/routes to this location are not ideal and it's been hard getting support to correct this. Our contract for our two servers ends in March/April respectively. If you currently have servers in this location you will be migrated over to the new provider. We'll have more details when the time comes closer to January. The new location for this change will be based out of Atlanta, GA. If you have any questions/concerns please open a ticket and we'll do our best to answer them.
      • 5 replies
    • Hello All,

      I wanted to give an update to how EZRCON is doing. As of today we have 56 active customers using the services offered. I'm glad its doing so well and it hasn't been 1 year yet. To those that have services with EZRCON, I hope the service is doing well and if not please let us know so that we can improve it where possible. We've done quite a few changes behind the scenes to improve the performance hopefully. 

      We'll be launching a new location for hosting procon layers in either Los Angeles, USA or Chicago, IL. Still being decided on where the placement should be but these two locations are not set in stone yet. We would like to get feedback on where we should have a new location for hosting the Procon Layers, which you can do by replying to this topic. A poll will be created where people can vote on which location they would like to see.

      We're also looking for some suggestions on what else you would like to see for hosting provider options. So please let us know your thoughts on this matter.
      • 4 replies
    • Added ability to disable the new API check for player country info


      Updated GeoIP database file


      Removed usage sending stats


      Added EZRCON ad banner



      If you are upgrading then you may need to add these two lines to your existing installation in the file procon.cfg. To enable these options just change False to True.

      procon.private.options.UseGeoIpFileOnly False
      procon.private.options.BlockRssFeedNews False



       
      • 2 replies
    • I wanted I let you know that I am starting to build out the foundation for the hosting services that I talked about here. The pricing model I was originally going for wasn't going to be suitable for how I want to build it. So instead I decided to offer each service as it's own product instead of a package deal. In the future, hopefully, I will be able to do this and offer discounts to those that choose it.

      Here is how the pricing is laid out for each service as well as information about each. This is as of 7/12/2020.

      Single MySQL database (up to 30 GB) is $10 USD per month.



      If you go over the 30 GB usage for the database then each additional gigabyte is charged at $0.10 USD each billing cycle. If you're under 30GB you don't need to worry about this.


      Databases are replicated across 3 zones (regions) for redundancy. One (1) on the east coast of the USA, One (1) in Frankfurt, and One (1) in Singapore. Depending on the demand, this would grow to more regions.


      Databases will also be backed up daily and retained for 7 days.




      Procon Layer will be $2 USD per month.


      Each layer will only allow one (1) game server connection. The reason behind this is for performance.


      Each layer will also come with all available plugins installed by default. This is to help facilitate faster deployments and get you up and running quickly.


      Each layer will automatically restart if Procon crashes. 


      Each layer will also automatically restart daily at midnight to make sure it stays in tip-top shape.


      Custom plugins can be installed by submitting a support ticket.




      Battlefield Admin Control Panel (BFACP) will be $5 USD per month


      As I am still working on building version 3 of the software, I will be installing the last version I did. Once I complete version 3 it will automatically be upgraded for you.





      All these services will be managed by me so you don't have to worry about the technical side of things to get up and going.

      If you would like to see how much it would cost for the services, I made a calculator that you can use. It can be found here https://ezrcon.com/calculator.html

       
      • 11 replies
    • I have pushed out a new minor release which updates the geodata pull (flags in the playerlisting). This should be way more accurate now. As always, please let me know if any problems show up.

       
      • 9 replies
×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.