Application running very slowly on server's internal ip and fast on localhost

Dear friends,

I am running an Yii application on a Linux server (Centos 7) with Postgresql but I am experiencing a tricky problem: My application runs fast only when I run in browser using http:\\localhost or http:\\127.0.0.1 and it runs very slowly using server internal IP (http:\\192.168.0.12 in my case) or any other workstation of my network.

Seems like a 5-7 seconds lag at every operation of tcp stack… I think localhost does not use tcp stack.

The Database Configuration is:

<?php

return CMap::mergeArray(

    require(dirname(__FILE__).'/main.php'),


    array(


            'components' =&gt; array(


        'db' =&gt; array(


            'connectionString' =&gt; 'pgsql:host=localhost;port=5432;dbname=f3producoes',


            'emulatePrepare'   =&gt; true,


            'username'         =&gt; 'hjshuy',


            'password'         =&gt; 'iiuoiu',


            'charset'          =&gt; 'utf8'


        )


    )


    )

);

~

Thanks in advance for any help.

Florêncio

Try using a memcache for decreasing the query hits on your database