SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 49 of 49
  1. #26
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote from support:
    This problem should not come back.
    I'm not holding my breath...

  2. #27
    Non-Member bitbytes's Avatar
    Join Date
    May 2006
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i never said we need to close connection everytime
    connect
    ..
    query1
    query2
    query3

    disconnect

    this is the proper way to do so , as well as i dont know what eaxct solution for this. am trying to help.
    sory 4 misguide.

  3. #28
    Non-Member Icheb's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    1,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, it's easy to say you meant something else when no one understands what you write in the first place.

  4. #29
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    luckily i didnt hold my breath. almost lasted a day. now its down again. and if im not loosing connectivity because of the database, then http goes down.

    it is rediculous. I am so sick of shared hosts, and all their empty promises. i want to go to a dedicated server, but i cant afford it.

    aaaaaarghh!!!!

    in case you were wondering, the host is site5.

    also, just out of interest, the boast over 200 000 clients. they have 57 servers listed here: http://www.site5.com/support/uptime.php

    you do the maths (also, each client can have 5 'real websites' - and that's not including resellers).

  5. #30
    Keep it simple, stupid! bokehman's Avatar
    Join Date
    Jul 2005
    Posts
    1,933
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by toasti
    i want to go to a dedicated server, but i cant afford it.
    If you have a full time broadband connection just run your own.

  6. #31
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would, but i live in south africa, and we have the most expensive bandwidth in the world, plus quite limiting on most of our connections. unfortunately its not really an option

    ...we also have a weak currency which makes things more expensive to

  7. #32
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok..what can i make of this now?

    all processes are up.
    port monitoring says it is up
    i can ping and tracert the server
    but i cant access my page from a browser (just get cached content).
    they say they have not suspended the site

    ?????????????????????

  8. #33
    SitePoint Zealot
    Join Date
    May 2006
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by toasti
    ok..what can i make of this now?

    all processes are up.
    port monitoring says it is up
    i can ping and tracert the server
    but i cant access my page from a browser (just get cached content).
    they say they have not suspended the site

    ?????????????????????
    Delete your cache and reload the page and see what you get.

    Also doesn't PHP automaticly close MySQL connections when the script has finished - I still recommend you use some kind of command to close the connection as well.

  9. #34
    Non-Member bitbytes's Avatar
    Join Date
    May 2006
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i have already recommend to close the connection.

  10. #35
    Non-Member bitbytes's Avatar
    Join Date
    May 2006
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    MySQL settings, many concurrent users.
    I run a site for a client that has over 3000 users that log in for about 5-7 hours
    per day each. So, at peak times, we have to handle about 2000 concurrent users.
    When configured correctly, PHP and MySQL can handle this load wonderfully on fairly
    cheap Intel architecture. First off, hardware.

    1) It is better to have 2 separate servers for Apache/PHP and MySQL with the Linux of your choice.
    2) Try not to run too much else on either box; leave the resources for Apache/PHP and MySQL.

    Here are the specs on each box in my config:
    1) Apache/PHP: Pentium 3, 600 MHZ, 512 megs ram.
    2) MySQL: Dual Pentium 3, 750 MHZ (1500 MHZ total), 2 gigs ram.

    The reason for this configuration is that it is very database heavy;
    it is a members only web site with username and password required for login, fully personalized.
    It is an online school, so each student has their suite of tools for attending school,
    their courses, report cards, time logging, and much more. Teachers have web based tools to create
    their courses, including lessons, text to speech audio, and more.

    1) PHP coding: be sure to use persistent connections!
    Opening and closing a connection from your Apache/PHP box to your MySQL box is a very heavy load.
    By using persistent connections, a high capacity site will open connections and share them to
    exchange data rather than opening a connection on each page request, sending the data, then closing,
    and repeating that process at least once for every user click!
    Be sure to use "mysql_pconnect" instead of "mysql_connect" and also that appropriate changes are made
    in "php.ini" or overridden by using the command "ini_set".
    You can find more documentation on doing this at the php web site.

    2) Apache set up ("httpd.conf"): I've changed these various settings, and played with them until they
    seem to keep the most "idle %" reported in "top".
    MinSpareServers 10
    MaxSpareServers 20
    StartServers 70
    MaxClients 255

    3) Mysql set up ("my.cnf"). The MySQL config file, my.cnf.
    Here is what to add under the [mysqld] heading.
    The two lines, "max_connections" and "max_user_connections" are where the magic happens.
    Since your Apache/PHP box is connecting to MySQL, it appears as a single user.
    MySQL defaults to 1 max connection, with 1 max connection per user. The following lines make
    it so your Apache/PHP box can connect to your MySQL box up to the number you have set "MaxClients"
    to in the Apache config above. By using persistent connections, you can pretty much get Apache up,
    have it connect to MySQL upon start up, and just use the persistent connections to pass data between
    the two boxes rather than opening connections. Its much more efficient that way.
    set-variable = max_connections = 300
    (this must be higher than "MaxClients" set in Apache, or you won't fully maximize use)
    set-variable = max_user_connections = 300
    set-variable = table_cache=1200
    (max number of tables in join multiplied by max_user_connections)

    A few other MySQL tunings:
    set-variable = max_allowed_packet=1M (sanity check to stop runaway queries)
    set-variable = max_connect_errors=999999
    (stop mysqld from shutting down if there are connect errors - this defaults to 1 error and mysqld stops!)

  11. #36
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi bitbytes. Thanks for the reply. I think the the mysql_pconnect thing is not good advice though. most resources are telling me that that is prob the cause of all my problems (even though i am not using persistant connections).

    Unfortunately, all the stuff you have told me about configuring my server is not use, cause i am on a shared host and clearly dont have access to those resources.

    I have re-examined my stats, and looking at them, i have prob just outgrown shared hosting. i had another site which had similar problems (which is now hosted on a VPS), so i was comparing. that site got 3000 visits a day, whereas this one only gets 3-400 visits, so i thought i had a way to go before i needed to worry about moving. BUT: what i neglected was that this site gets 20 pageviews / visit, compared to the 3 which the other site was getting. So the traffic is fairly comparable.

    As i mentioned before, i cant afford a dedicated host, so been searching franticly for something. found some nice looking VPS solutions at rackforce (looks a little like a cheap knockoff of rackspace...).
    http://www.rackforce.com/dds_dedicat...e_servers.html
    Has anyone any experience with them? u reckon that could solve my problems?

  12. #37
    Non-Member Icheb's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    1,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bokehman
    If you have a full time broadband connection just run your own.
    Broadband can also mean 128kbit upstream, which certainly is not suited for hosting a webserver.

    Quote Originally Posted by bitbytes
    i have already recommend to close the connection.
    And as I have already told you, this is not necessary. Read my post again if you want to know why.
    And did you just copy and paste that post from another source or something? Because it's so irrelevant that it's sad. His MySQL server says it's refusing connections because there are too many connections, so if he had his own server he would just change that setting, now wouldn't he?
    Using persistent connections is just as counterproductive, but I'm not going to repeat my former post.

    Quote Originally Posted by toasti
    u reckon that could solve my problems?
    Certainly, because then you can just change the settings. However, be cautious when it comes to VPS solutions. Some hosts overload their servers with accounts, essentially crippling every account on it.

  13. #38
    Keep it simple, stupid! bokehman's Avatar
    Join Date
    Jul 2005
    Posts
    1,933
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Icheb
    Broadband can also mean 128kbit upstream, which certainly is not suited for hosting a webserver.
    I've successfully hosted a webserver over a 128kbs connection and currently am using a 300kbs connection for all the links in my signature as well as many others. I am currently serving about 10,000 pages a day (65,000 hits) and no one has every complained about the speed yet.

  14. #39
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Certainly, because then you can just change the settings. However, be cautious when it comes to VPS solutions. Some hosts overload their servers with accounts, essentially crippling every account on it.
    VEs per Physical Host: 12
    is that accounts per host? does 12 sounds about right? its a 2.8 Xeon...

    Also 200 min gaurenteed RAM. is that enough? ...how much would one be getting on a typical shared host?

  15. #40
    Non-Member bitbytes's Avatar
    Join Date
    May 2006
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Icheb
    Broadband can also mean 128kbit upstream, which certainly is not suited for hosting a webserver.
    He thinks that he is the smartest person in this forum.

    128kbit/s is suitable for email, surfing the web and online text based conferencing. It is just about usable for voice over IP, but inadequate for IP based videoconferencing.

  16. #41
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can someone explain this to me?

    It looks like your site is dependant on http includes in PHP, and these were disabled on your account via a firewall rule.

    If you're using a lot of http includes, and receiving a fair amount of traffic, this can be blocked because it looks like hundreds of connections from a single IP.

    If possible, you shouldn't use http includes.
    by http includes does he mean <?php require_once(); ?>?

  17. #42
    Keep it simple, stupid! bokehman's Avatar
    Join Date
    Jul 2005
    Posts
    1,933
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My guess is it means in a URL wrapper.

  18. #43
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok...asked him what he meant. here is the reply:

    What you just did was a filesystem include (i said: require_once('file.php')), not an http include. There are absolutely no problems with filesystem includes.

    An http include would actually include the file over http. include("http://example.com/file.php");
    Do you think that http includes might cause one to open more database connections? perhaps they load up the included page in a seperate thread or something.

    I found one http include for a form on my left-side column, so that would have been included on every page. which would make sense.

  19. #44
    Keep it simple, stupid! bokehman's Avatar
    Join Date
    Jul 2005
    Posts
    1,933
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's that got to do with a MySQL connection?

  20. #45
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bokehman
    What's that got to do with a MySQL connection?
    ..well once they fixed (probably temporarily -> time will tell), the db problem. they then made my site unavailable by firewalling it...

    I was just wondering if http includes might work differently to normal file includes in PHP so that http included files did open new connections. i doubt it though.

  21. #46
    Non-Member Icheb's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    1,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bitbytes
    He thinks that he is the smartest person in this forum.

    128kbit/s is suitable for email, surfing the web and online text based conferencing. It is just about usable for voice over IP, but inadequate for IP based videoconferencing.
    It's not me who is writing irrelevant posts all the time. I am merely the person who is disagreeing with these posts of you, so stop accusing me of thinking that I am the smartest person here if you can't back that up.

    Quote Originally Posted by bokehman
    I've successfully hosted a webserver over a 128kbs connection and currently am using a 300kbs connection for all the links in my signature as well as many others. I am currently serving about 10,000 pages a day (65,000 hits) and no one has every complained about the speed yet.
    Sure, a site with relatively low traffic is fine for 128kbps. But you only need three or more people in the evening to open a page at the same time and the speed of each one of them will go down. Offering larger images or even downloads would make 128kpbs totally unfeasible for websites.

    Quote Originally Posted by toasti
    I was just wondering if http includes might work differently to normal file includes in PHP so that http included files did open new connections. i doubt it though.
    With http includes they mean using include() on a file which is located on a remote server. There is no difference when it comes to MySQL connections between include('bla'); or include('http://yoursite.com/bla'); if both pages are on your server.

  22. #47
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bitbytes recommended using persistent connections when the MySQL server is a physically separate machine to your web server. The latency involved in connecting is greater because it's over a network.
    It doesn't mean permanent connections are right for a single-server site.

  23. #48
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,514
    Mentioned
    37 Post(s)
    Tagged
    1 Thread(s)
    Hosting a web server at home isn't very sensible (the reasons have been covered in the web hosting forum many many times but to reiterate - bandwidth, latency, hardware and 24/7 energy costs, security, 24/7/365 service, consistency are all negatively affected by hosting at home. It's actually more expensive than most normal shared hosting once you factor in all costs).

    If you're unable to use a better host (the simple solution) then you may be able to implement a cache system with any data that doesn't update too frequently to avoid performing a query.
    e.g
    Get age of cache file, If still fresh - load and use data, else perform query and write new data.
    This way you can decimate the amount of queries made albeit with increased file access overhead.

  24. #49
    Internet Evangelist bweeb's Avatar
    Join Date
    Jun 2005
    Location
    USA
    Posts
    525
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by toasti View Post
    luckily i didnt hold my breath. almost lasted a day. now its down again. and if im not loosing connectivity because of the database, then http goes down.

    it is rediculous. I am so sick of shared hosts, and all their empty promises. i want to go to a dedicated server, but i cant afford it.

    aaaaaarghh!!!!

    in case you were wondering, the host is site5.

    also, just out of interest, the boast over 200 000 clients. they have 57 servers listed here: http://www.site5.com/support/uptime.php

    you do the maths (also, each client can have 5 'real websites' - and that's not including resellers).
    That is very odd, can you tell me the support ticket ID and I would be happy to review it?

    We have 25,000 clients, we host over 220,000 domains and we have over 300 servers.

    Thanks, Ben
    CEO of Site5 Web Hosting - 18 Locations around the world, 45,000+ happy customers!
    WebPub.com - Automatic WordPress Upgrades (New Startup)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •