PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Localhost vs remote MySQL Server
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Localhost vs remote MySQL Server

Réponse
 
LinkBack Outils de la discussion
Vieux 07/11/2007, 20h17   #1
FalkoL
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Localhost vs remote MySQL Server

Hello. We changed our Server system from a single Server to a Cluster
system using MySQL 5 as DB. We have two Mysql Server 1xmaster 1xslave.
Since we changed the Server system our Queries running slower and
sometimes the hole DB Server crush. What never happend before on the
Single Server system we never had a issue with that.

Question is what is the real different between having the MySQL and
Apache server on the same system as havening 3 web server 2 DB Server
and 2 File server connected with 1 Gbit internal Network.
Could that lead to slower Queries?

Thank you for your .

Falko

  Réponse avec citation
Vieux 07/11/2007, 20h42   #2
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Localhost vs remote MySQL Server

FalkoL wrote:
> Hello. We changed our Server system from a single Server to a Cluster
> system using MySQL 5 as DB. We have two Mysql Server 1xmaster 1xslave.
> Since we changed the Server system our Queries running slower and
> sometimes the hole DB Server crush. What never happend before on the
> Single Server system we never had a issue with that.
>
> Question is what is the real different between having the MySQL and
> Apache server on the same system as havening 3 web server 2 DB Server
> and 2 File server connected with 1 Gbit internal Network.
> Could that lead to slower Queries?


Of course it's always faster to have a localhost server, no matter if
it's mysql or any other kind of server, as it's faster to fetch
something without getting out on a network.

There shouldn't be any noticeable difference between localhost and a
server which you connect over a short cable which uses gigbit network.

Troubles that can cause these kind of slow downs can be:

- The mysql configuration is badly done on the servers
- Firewall badly setup which makes that the first server requested
fails, has to wait out for time out before trying next server
- Faulty NIC which causes a lot of lost packages
- Badly written SQL queries which has to send a lot of unnecessary data
for each query
- File system on servers are extremely slow due wrong driver used or a
bad file system selected like vfat/ntfs or hard drive breaking down.

There may be even more reasons for the slow down... but I think you
should take a look on the servers that they are properly configured.

--

//Aho
  Réponse avec citation
Vieux 07/11/2007, 20h56   #3
FalkoL
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Localhost vs remote MySQL Server

Hi Aho,

we will check all the thinks above.

Our DB Server is a HP Dual Intel Xeon Core 2 Duo with 4 GB RAM that is
our my.cnf

[mysqld]
key_buffer_size=400M
key_buffer=400M
table_cache=512M

join_buffer_size=5M
sort_buffer_size=50M
read_buffer_size=5M
myisam_sort_buffer_size = 32M

query_cache_size=450M
query_cache_type=1
query_cache_limit=64M

max_connections=5000

thread_cache=400M
thread_cache_size=400M
thread_concurrency=2
thread_stack=1M

#concurrent_insert=2
#max_connections = 512
#max_user_connections = 256
interactive_timeout = 250
wait_timeout = 10
connect_timeout = 15

skip-external-locking
skip-bdb
skip-innodb

long_query_time = 1
log-slow-queries = /var/log/mysql/mysql-slow.log

tmp_table_size = 256M

Would you count this as Badly?


Thank you for your .

Falko

On Nov 7, 12:42 pm, "J.O. Aho" <u...@example.net> wrote:
> FalkoL wrote:
> > Hello. We changed our Server system from a single Server to a Cluster
> > system using MySQL 5 as DB. We have two Mysql Server 1xmaster 1xslave.
> > Since we changed the Server system our Queries running slower and
> > sometimes the hole DB Server crush. What never happend before on the
> > Single Server system we never had a issue with that.

>
> > Question is what is the real different between having the MySQL and
> > Apache server on the same system as havening 3 web server 2 DB Server
> > and 2 File server connected with 1 Gbit internal Network.
> > Could that lead to slower Queries?

>
> Of course it's always faster to have a localhost server, no matter if
> it's mysql or any other kind of server, as it's faster to fetch
> something without getting out on a network.
>
> There shouldn't be any noticeable difference between localhost and a
> server which you connect over a short cable which uses gigbit network.
>
> Troubles that can cause these kind of slow downs can be:
>
> - The mysql configuration is badly done on the servers
> - Firewall badly setup which makes that the first server requested
> fails, has to wait out for time out before trying next server
> - Faulty NIC which causes a lot of lost packages
> - Badly written SQL queries which has to send a lot of unnecessary data
> for each query
> - File system on servers are extremely slow due wrong driver used or a
> bad file system selected like vfat/ntfs or hard drive breaking down.
>
> There may be even more reasons for the slow down... but I think you
> should take a look on the servers that they are properly configured.
>
> --
>
> //Aho



  Réponse avec citation
Vieux 07/11/2007, 21h24   #4
Paul Lautman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Localhost vs remote MySQL Server

FalkoL wrote:
> On Nov 7, 12:42 pm, "J.O. Aho" <u...@example.net> wrote:
>> FalkoL wrote:
>>> Hello. We changed our Server system from a single Server to a
>>> Cluster system using MySQL 5 as DB. We have two Mysql Server
>>> 1xmaster 1xslave. Since we changed the Server system our Queries
>>> running slower and sometimes the hole DB Server crush. What never
>>> happend before on the Single Server system we never had a issue
>>> with that.

>>
>>> Question is what is the real different between having the MySQL and
>>> Apache server on the same system as havening 3 web server 2 DB
>>> Server and 2 File server connected with 1 Gbit internal Network.
>>> Could that lead to slower Queries?

>>
>> Of course it's always faster to have a localhost server, no matter if
>> it's mysql or any other kind of server, as it's faster to fetch
>> something without getting out on a network.
>>
>> There shouldn't be any noticeable difference between localhost and a
>> server which you connect over a short cable which uses gigbit
>> network.
>>
>> Troubles that can cause these kind of slow downs can be:
>>
>> - The mysql configuration is badly done on the servers
>> - Firewall badly setup which makes that the first server requested
>> fails, has to wait out for time out before trying next server
>> - Faulty NIC which causes a lot of lost packages
>> - Badly written SQL queries which has to send a lot of unnecessary
>> data for each query
>> - File system on servers are extremely slow due wrong driver used or
>> a bad file system selected like vfat/ntfs or hard drive breaking
>> down.
>>
>> There may be even more reasons for the slow down... but I think you
>> should take a look on the servers that they are properly configured.
>>
>> --
>>
>> //Aho

> Hi Aho,
>
> we will check all the thinks above.
>
> Our DB Server is a HP Dual Intel Xeon Core 2 Duo with 4 GB RAM that is
> our my.cnf
>
> [mysqld]
> key_buffer_size=400M
> key_buffer=400M
> table_cache=512M
>
> join_buffer_size=5M
> sort_buffer_size=50M
> read_buffer_size=5M
> myisam_sort_buffer_size = 32M
>
> query_cache_size=450M
> query_cache_type=1
> query_cache_limit=64M
>
> max_connections=5000
>
> thread_cache=400M
> thread_cache_size=400M
> thread_concurrency=2
> thread_stack=1M
>
> #concurrent_insert=2
> #max_connections = 512
> #max_user_connections = 256
> interactive_timeout = 250
> wait_timeout = 10
> connect_timeout = 15
>
> skip-external-locking
> skip-bdb
> skip-innodb
>
> long_query_time = 1
> log-slow-queries = /var/log/mysql/mysql-slow.log
>
> tmp_table_size = 256M
>
> Would you count this as Badly?
>
>
> Thank you for your .
>
> Falko
>

Please do not top post (top posting fixed)


  Réponse avec citation
Vieux 07/11/2007, 22h56   #5
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Localhost vs remote MySQL Server

FalkoL wrote:
> Hello. We changed our Server system from a single Server to a Cluster
> system using MySQL 5 as DB. We have two Mysql Server 1xmaster 1xslave.
> Since we changed the Server system our Queries running slower and
> sometimes the hole DB Server crush. What never happend before on the
> Single Server system we never had a issue with that.
>
> Question is what is the real different between having the MySQL and
> Apache server on the same system as havening 3 web server 2 DB Server
> and 2 File server connected with 1 Gbit internal Network.
> Could that lead to slower Queries?
>
> Thank you for your .
>
> Falko
>
>


That depends.

If you're CPU bound on your old server, moving the database to a
different server could very well speed things up. And the same could be
true if you have I/O contention between the MySQL server and the web
server, although it's less likely.

But moving MySQL to a separate server also typically gives you more
resources - memory, etc.

Now the time it takes to transfer data between MySQL and your
application will, of course, be longer, even on a 1GB network. How much
slower depends, of course, on the amount of data being transferred. But
even things like connecting will take longer.

So the bottom line is - it can be slower, but I wouldn't expect it the
be that much slower.

However, you've also added one other thing - the master/slave
relationship. It means both servers will have more work to do than when
you had a single server. How much depends on how often your data
changes. But that is going to slow it down.

My recommendation would be to not try to change so much so quickly. Get
it running with a single MySQL server to start. Compare MySQL config
parameters between the old and new systems, and at tuning the single
system. Once you get that working as well as possible, add the slave.
You might have to tune a little more, but it shouldn't be that much.



--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 08/11/2007, 04h00   #6
Peter H. Coffin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Localhost vs remote MySQL Server

On Wed, 07 Nov 2007 20:17:51 -0000, FalkoL wrote:
> Hello. We changed our Server system from a single Server to a Cluster
> system using MySQL 5 as DB. We have two Mysql Server 1xmaster 1xslave.
> Since we changed the Server system our Queries running slower and
> sometimes the hole DB Server crush. What never happend before on the
> Single Server system we never had a issue with that.
>
> Question is what is the real different between having the MySQL and
> Apache server on the same system as havening 3 web server 2 DB Server
> and 2 File server connected with 1 Gbit internal Network.
> Could that lead to slower Queries?
>

It's possible, but not terribly likely.... unless those file servers are
ALSO holding your database stores...

--
Windows gives you a nice view of clouds so you can't see any potentially
useful boot time messages.
-- Bill Hay in the Monastery
  Réponse avec citation
Vieux 08/11/2007, 21h51   #7
Brian Wakem
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Localhost vs remote MySQL Server

FalkoL wrote:

> Hi Aho,
>
> we will check all the thinks above.
>
> Our DB Server is a HP Dual Intel Xeon Core 2 Duo with 4 GB RAM that is
> our my.cnf
>
> [mysqld]
> key_buffer_size=400M
> key_buffer=400M
> table_cache=512M



The M should not be there, you cannot cache 512 million tables.


> join_buffer_size=5M
> sort_buffer_size=50M
> read_buffer_size=5M
> myisam_sort_buffer_size = 32M
>
> query_cache_size=450M
> query_cache_type=1
> query_cache_limit=64M
>
> max_connections=5000



I bet your server will crash long before you have 5000 connections.


> thread_cache=400M



I don't think I've ever seen a thread_cache over 100 or so. 400 million in
ludicrous.


> thread_cache_size=400M
> thread_concurrency=2



thread_concurrency is traditionally 2 * CPUs (or cores these days), try 8.


Also you may like to restart mysql with --skip-name-resolve otherwise you
will pay for a DNS and rDNS lookup for every connection. If you have slow
DNS this will cause lots of problems.


--
Brian Wakem
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 21h27.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,17791 seconds with 15 queries