Thread: Question about remote sql[If Wrong Section Mod Please Move]

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1 Question about remote sql[If Wrong Section Mod Please Move] 
    Im an albatraoz

    Nand0's Avatar
    Join Date
    Feb 2010
    Age
    31
    Posts
    948
    Thanks given
    233
    Thanks received
    128
    Rep Power
    241
    Okay so i rent webhosting from trentahost as a vps.
    Lately Vps connecting to remote sql has been slow as shit.
    Voting for example lags a player like 5 seconds, and when starting my server it takes ages before gtl is connected.
    Now the odd thing is that when i connect to the remote sql from my local computer it connects almost instantly and there is no lagg/delay.
    The vps connecting to the sql is causing server laggs with highscore saving/when alot of players vote.
    Anyone got any idea what the problem could be?



    Looking for blazing fast and affordable vps or web hosting?
    AllGeniusHost



    Reply With Quote  
     

  2. #2  
    Registered Member
    Sieu's Avatar
    Join Date
    Dec 2011
    Age
    30
    Posts
    1,167
    Thanks given
    186
    Thanks received
    131
    Rep Power
    160
    If you create an api it might be a lighter load. You need to manage your resources more carefully because runtime is shit on these web servers that you get for like $1.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Freezia's Avatar
    Join Date
    Feb 2011
    Posts
    6,013
    Thanks given
    1,147
    Thanks received
    758
    Rep Power
    1311
    Who is your hosting provider? You might want to run some test from your VPS to the webhosting server to see if there is any network issues.


    Host your RUNESCAPE PRIVATE SERVER on the cheapest and flagship provider on Rune-Server! Now equipped with DDOS Protection!.


    Reply With Quote  
     

  4. #4  
    Im an albatraoz

    Nand0's Avatar
    Join Date
    Feb 2010
    Age
    31
    Posts
    948
    Thanks given
    233
    Thanks received
    128
    Rep Power
    241
    Quote Originally Posted by Freezia View Post
    Who is your hosting provider? You might want to run some test from your VPS to the webhosting server to see if there is any network issues.
    You are i made a ticket about it [Ticket ID: 578080]



    Looking for blazing fast and affordable vps or web hosting?
    AllGeniusHost



    Reply With Quote  
     

  5. #5  
    Registered Member
    Freezia's Avatar
    Join Date
    Feb 2011
    Posts
    6,013
    Thanks given
    1,147
    Thanks received
    758
    Rep Power
    1311
    Quote Originally Posted by Nand0 View Post
    You are i made a ticket about it [Ticket ID: 578080]
    Perfect, Derek will update you accordingly.

    I have pushed your ticket in his queue so he will be the only one to solve and update it.


    Host your RUNESCAPE PRIVATE SERVER on the cheapest and flagship provider on Rune-Server! Now equipped with DDOS Protection!.


    Reply With Quote  
     

  6. #6  
    Unfortunately we’re all human. Except me


    Join Date
    Aug 2011
    Posts
    926
    Thanks given
    539
    Thanks received
    439
    Rep Power
    601
    You shouldnt use mysql connection on server to connect to database. There are better ways of doing it for example http requests.
    Reply With Quote  
     

  7. Thankful user:


  8. #7  
    Im an albatraoz

    Nand0's Avatar
    Join Date
    Feb 2010
    Age
    31
    Posts
    948
    Thanks given
    233
    Thanks received
    128
    Rep Power
    241
    Quote Originally Posted by Freezia View Post
    Perfect, Derek will update you accordingly.

    I have pushed your ticket in his queue so he will be the only one to solve and update it.
    Yeah but in the long run googled learned me what is causing it i downloaded my raw access logs and the way someone is trying to bruteforce my vps is also sending massive amounts of requests to my webhosting, haven't found a way to block it yet since the ip/user agents keep changing >.> btw is the maintaince in progress? i was rebuilding my vps with a vpn till the dedicated ip change would come trough and now im offline



    Looking for blazing fast and affordable vps or web hosting?
    AllGeniusHost



    Reply With Quote  
     

  9. #8  
    Registered Member MDev's Avatar
    Join Date
    Apr 2015
    Age
    30
    Posts
    108
    Thanks given
    21
    Thanks received
    11
    Rep Power
    6
    Buy a more expensive VPS when using allot of MySQL most of the cheap VPS servers can't handle that many queries.
    Otherwise (whitout upgrading your vps) just generate a rand unique id on your VPS and confirm it on your PHP (web host) depending on what id u get u will get the right page, than just execte the querys on the web server instead of your VPS.
    When one id is used generate another for someone else ex: voting or highscore update or anywhat.
    Reply With Quote  
     

  10. #9  
    Registered Member

    Join Date
    Dec 2011
    Posts
    1,615
    Thanks given
    1,971
    Thanks received
    819
    Rep Power
    1049
    Quote Originally Posted by LukaFurlan View Post
    You shouldnt use mysql connection on server to connect to database. There are better ways of doing it for example http requests.
    Very conditional that this would be a better approach, you'd have to control the submissions and essentially create an API around it making for even more opportunity for a vulnerability to a surface.
    Reply With Quote  
     

  11. #10  
    Registered Member
    Join Date
    Jul 2014
    Posts
    49
    Thanks given
    1
    Thanks received
    15
    Rep Power
    23
    Quote Originally Posted by LukaFurlan View Post
    You shouldnt use mysql connection on server to connect to database. There are better ways of doing it for example http requests.
    No. Just no.

    My personal recommendation would firstly, use a connection pool. The c3p0 library is excellent for this, and it's incredibly easy to use:
    Code:
    private ComboPooledDataSource pool = new ComboPooledDataSource();
    
    pool.setDriverClass("com.mysql.jdbc.Driver");
    pool.setJdbcUrl(String.format("jdbc:mysql://%s:%d", host, port));
    pool.setUser(username);
    pool.setPassword(password);
    You can retrieve a connection from the data source, just make sure to close the connection and appropriate statements after use, to return them to the pool. The delay would likely be due to latency between your server, and SQL provider (speaking of which, why don't you just host the SQL server locally, rather than making remote calls to the database? MySQL is incredibly simple to install). If you're just using the database to update highscore rows, you can execute the queries on a separate thread. Similarly, you'd want to query and process the vote queries and reward processing on a separate thread.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Helping Thread [Change if Wrong Section]
    By Defiled RSPS in forum Help
    Replies: 1
    Last Post: 05-20-2014, 11:41 PM
  2. Barrows Script (move if wrong section)
    By chilleno in forum Help
    Replies: 0
    Last Post: 10-22-2012, 07:17 PM
  3. Website help(sorry if wrong section)
    By Richie in forum Help
    Replies: 0
    Last Post: 01-01-2011, 06:13 AM
  4. Sorry if wrong section.
    By Kewl jack in forum Help
    Replies: 1
    Last Post: 06-16-2009, 08:23 AM
  5. !!WARNING!! (move if wrong section)
    By TrollCount++ in forum Chat
    Replies: 10
    Last Post: 06-25-2008, 03:24 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •