Home › Forum › Problemi Vari con WP › Connessioni al database Tophost
-
AutorePost
-
-
10 Dicembre 2012 alle 19:56 #23305rapstylePartecipante
Ciao a tutti,
da un po’ di tempo nel mio sito(netclick.it) c’è il noto errore “Error estabilishing a database connection”, ma non appare sempre, ma solo qualche volta, e per tornare a visualizzare la pagina al sito basta aggiornare la pagina.Ho controllato il file wp-config.php ed è tutto apposto.Il mio hosting provider è tophost, gli ho mandato una mail e hanno risposto in questo modo:
“Il messaggio è relativo al fatto che termina le connessioni simultanee disponibili (otto) al server DB e le successive vengono rifiutate.
Le consigliamo di controllare le query SQL effettuate, eventualmente di ottimizzarle, di chiudere correttamente le connessioni al server DB ed attivare qualche sistema di caching per gli script che fanno uso del DB in modo da ridurre le connessioni verso quest’ultimo
Le auguriamo buona giornata e buon fine settimana.”
Com’è possibili che terminano le connessioni disponibili al database?Tempo fa quando facevo molto più visite riuscivano a stare online pure 50-60 utenti contemporaneamente senza che apparisse questo errore, mentre ora lo fa ogni tanto pure se sono connesso solo io in piena notte!Tra l’altro in questi giorni il sito sembra pure più lento del solito.Uso già un sistema di caching con il plugin WP Super Cache.
Il tecnico ha detto di controllare e ottimizzare le query effettuate, ma onestamente non ho nessuna idea di come si fa.
Voi avete qualche soluzione da propormi?Non so come muovermi e con questo errore perdo pure posizioni su Google.Grazie in anticipo!
-
11 Dicembre 2012 alle 11:10 #99284TittiModeratore
Il primo controllo da fare è sui plugin, potresti averne installato uno ultimamente che fa molte interrogazioni al database.
-
11 Dicembre 2012 alle 13:06 #99289SteveAglAmministratore del forum
Soluzione: cambiare hosting
-
11 Dicembre 2012 alle 14:17 #99294rapstylePartecipante
Mmm ultimamente l’unico plugin che ho installato è WordPress Seo by Yoast, ma l’errore compariva già prima.Forse qualcuno aggiornandosi ha causato questo problema.Vuoi che ti posto la lista dei plugin, Titti?
Steve, mancano 40 giorni alla fine dell’abbonamento con l’hosting, dopo valuterò se cambiare.
-
11 Dicembre 2012 alle 19:40 #99311
-
11 Dicembre 2012 alle 20:01 #99314SteveAglAmministratore del forum
Dopo che è scaduto ed il sito sarà offline e non potrai accedere al db e all’FTP? Complimenti… ottima pianificazione.. io farei tutto 40 ore prima cosi manco il tempo di cambiare mantainer del dominio e propagare i dns.. AUGURI.
PS 9.3 secondi di generazione della pagina.. quasi un minuto prima che finisca di caricare tutto il mondo che carica (millemila facebook etc) le posizioni su goggle le perdi per quello mica per altro.. sarà l’hosting più lento perchè sei su macchine molto cariche anche da altri siti o altro.. ma direi che lavoro per ottimizzare ce ne’è molto… ma le regole e le strategie sono molto variabili in funzione di plugin usati, tema, ottimizzazioni possibili etc etc… che non si possono esaurire in poche righe di un forum e che richiedono competenze sistemistiche e di sciluppo non di primo livello.
Per dire http://www.duechiacchiere.it/ sta dove stai tu fa un fracasso di traffico essendo popolarissimo.. e va a fulmine.. certo lui è un professionista che ha limato tutto il limabile… ha un sito leggero apposta.. noi siamo stati su TH per alcuni anni.. poi si cambia per forza.. a 10 euro/l’anno le prestazioni possibili sono quelle che sono.
-
11 Dicembre 2012 alle 20:07 #99316SteveAglAmministratore del forum
http://img834.imageshack.us/img834/373/gtychristmaspresentsjef.jpg 280K di immagine? localmente ne ho fatto una versione di meno di 40K che a video appare pressochè identica.. giusto per ottimizzare due cosette che poi quell’immagine ad esempio non vine tenuta in cache dal browser ed inf atti pagespeed su chrome segnala subito la cosa..
Direi che cose da ottimizzare come detto ce ne sono molte.. probabilmente il rendering delle pagine tiene impegnata la conessione al db molto a lungo e nei momenti di picco tocchi i liiti.. pagine veloci diminuiscono questi tempi.. poi mi pare che tu non serva pagina in cache acnhe se dici di avere un plugin attivo.. sicuro che agli utenti non loggati servi le pagine cachate?
-
12 Dicembre 2012 alle 18:50 #99363rapstylePartecipante
Titti grazie per la segnalazione, cercherò qualche plugin simile che fa al caso mio.
Steve grazie anche a te per le critiche costruttive.
Innanzitutto, ovviamente cambierò hosting almeno 2 giorni prima della fine del contratto, non sono cosଠstupido da far andare il mio sito offline.
Quello degli script invece è il problema più importante del sito.Tempo fa avevo ottimizzato la pagina seguendo i suggerimenti di Google Pagespeed e il punteggio era arrivato a 91.Tra le cose in negativo rimaste che nn ero riuscito ad aggiustare erano rimasti proprio gli script.Il problema è che sono tutti dei social network e sono sempre loro a caricarsi per ultimi.Ho tolto i box mi piace per fb e g+ che erano i + lenti e messi al posto loro delle icone che indirizzavano ai social.Ora il problema rimane che nella home ho un sacco di altri pulsanti visto che stanno sopra ogni articolo.
Due chiacchiere è incredibilmente veloce, è vero, ma non vedo nemmeno un pulsante di condivisione o box per i social network.Se pure lui inserisse alcuni script pure il suo sito sarebbe più lento, anche se non dico quanto il mio.
L’immagine come hai fatto a ridurla cosଠtanto?Hai usato qualche programma?Se l’immagine è troppo grande non va in cache?
Comunque è strano che il sito non ti ha servito una pagina cachata, visto che il plugin c’è e dovrebbe funzionare per tutti.Probabilmente hai visitato il sito in un momento in cui ho cancellato la cache: lo faccio se ho fatto cambiamenti che non si vedono per colpa della cache.
-
12 Dicembre 2012 alle 19:05 #99364SteveAglAmministratore del forum
immagine ridotta brutalmente con irfanview.. ma si può fare certamente di meglio… usando smush.it o similari… che l’immagine vada in cache o meno non dipende dalla sua dimensione.. ovvio che ci va ma chi la vede la prima volta se la piglia… e se guardi con pagespeed quelle immagini non hanno expire ee quindi ad esempio una richiesta per saper se sono cambiate viene fatta sempre e comunque.. il web ti puo dare info su come aggiungere cose all’htaccess per migliorare le cache (etags rimossi, expire predefiniti lunghi no check per giorni/settimane sulle immagini etc… meno connessioni meno tempo impiegato ad aspettare risposte = pagina scaricata prima macchina liberata prima.. minori connessioni DB aperte.. etc etc
Si possono inventare varie tecniche per i pulsanti es cache locali script attivati solo sul click etc… ma esulano da WP in se stesso.. il web ti può dare informazioni in vari modi.. ma in ogni caso probabilmente la macchina su cui sei è lenta perchè sovraccarica… spostare il sito due gg prima augugri beh meglio rischiare problemi che buttar via 1 euro di hosting già pagato traslocando il mese precedente Ripeto auguri
-
12 Dicembre 2012 alle 22:49 #99367rapstylePartecipante
Ok farò come mi hai detto.Grazie per tutti i consigli steve
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.