Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

slow loading of main page on Debian etch

Help
vbecher
2008-12-23
2013-05-28
  • vbecher
    vbecher
    2008-12-23

    I installed refbase on a debian etch system. The bibutils had to be installed from the testing distribution.
    If i call the start page the server needs quite a while (10 - 20 s) to load the page. If i call a show.php site the server is faster.

    What can be the problem?

    My configuration is as follows:

        *  Which version of refbase do you use?
    0.9.5
        * Which platform are you using?
    Apache/2.2.3 (Debian) PHP/5.2.0-8+etch13 proxy_html/2.5
        * Do you use a particular package such as XAMPP?
    Debian etch
        * Which versions of Apache, MySQL and PHP are you running?
    # MySQL-Client-Version: 5.0.32
        * Can you execute other PHP web applications just fine? I.e., is it only refbase that is causing you trouble?
    yes, everything else works find
        * Can you access MySQL correctly, from the command line as well as from web administration tools such as phpMyAdmin?
    yes
        * Do you experience the same error/problem using a different browser or computer?
    yes
        * Do you know about special config settings within your httpd.conf, php.ini or my.cnf configuration files?
    no
        * Compare your php.ini with the list of required php.ini settings and report any differences.
    no differences
        * Regarding php.ini settings, especially verify that safe_mode is OFF for installation. If you can't change this setting, you may need to perform a manual installation.
    it is off
        * Have a look at your server's error log and report anything that may be connected with refbase.
    nothing

     
    • Hi vbecher,

      thanks for the clear problem report, and sorry for the late reply, been travelling.

      > If i call the start page the server needs quite a while (10 - 20 s)
      > to load the page.

      The 'index.php' page loads the five most recently added publications via a 'show.php' request that's similar to this one:

      show.php?records=all&submit=Cite&showRows=5&citeOrder=creation-date

      I.e., similar to the "Show All" link in the refbase page header, the query actually returns all records ('records=all') but only the five most recent entries are displayed.

      Depending on the performance of your server and the number of records in your MySQL database, asking for all records in the database may cause some speed delays. However, a page load time of 10-20 seconds seems a bit much IMHO.

      > If i call a show.php site the server is faster.

      This is probably due to the fact, that the MySQL queries for the visible 'show.php' links are more focused and thus more effective.

      Questions:

      1. How many records do you have in your refbase MySQL database?

      2. If you click the "Show All" link in the refbase page header, how long does it take until the results page is fully loaded? Is this any faster than loading 'index.php'?

      3. If you execute an equivalent raw SQL statement ("SELECT * FROM refs;") on your server's refbase database via the MySQL command line interpreter, is this any faster?

      Thanks, Matthias

       
      • vbecher
        vbecher
        2008-12-30

        Hi Matthias,

        Questions:

        1. How many records do you have in your refbase MySQL database?

        its 632 records in the mysql database refs

        2. If you click the "Show All" link in the refbase page header, how long does it take until the results page is fully loaded? Is this any faster than loading 'index.php'?

        If i click after a long wait for index.php (and it comes) on show all, the side appears directly.

        3. If you execute an equivalent raw SQL statement ("SELECT * FROM refs;") on your server's refbase database via the MySQL command line interpreter, is this any faster?

        yes it is. it takes 0.0019 sek to display the first 30 rows.

        I think there is some php function which is very slow on my system in index.php.  If i wait for the index.php, no other refbase site is working, but the other php site on my server.

        What do you think?

        Valentin

         
    • Hi Valentin,

      thanks for answering my questions. Since your "Show All" link as well as the raw SQL query execute fast, it can only be a problem with how the "Show All" query is executed internally from within 'index.php'.

      To fetch the most recent records, 'index.php' uses function 'fetchDataFromURL()' (in 'include.inc.php') which, in turn, uses PHP function 'fopen()'.

      Do you actually get the five most recently added publications displayed on the main page ('index.php')? I.e., your main page should similar to this one:

      http://polaris.ipoe.uni-kiel.de/refs/

      If instead, you just see a "Show All" link in the main body of the page, like this:

      Most recently added publications:
         Show All

      then this is probably since the 'fopen()' function has been disabled on your server. So the 'index.php' script probably waits for the 'fopen()' request until your server's maximum script execution time has been reached.

      You'll need to talk to your server's administrator if they are willing to enable the 'fopen()' function for you.

      If not, then you'll need to comment out line 406 in 'index.php' which calls function 'fetchDataFromURL()'. Your main page should load fast then, but obviously it won't display the most recently added records.

      Hope this helps,

      Matthias

       
    • vbecher
      vbecher
      2009-01-03

      Hi Matthias,

      thanks for you help, it solved the problem. If i comment out line 406, refbase works like a charm.

      my fopen() function on the server is somehow malfunctioning.

      Refbase is really quite nice.

      Valentin

       
  • heem
    heem
    2010-08-05

    Our webadmin doesn't allow the function fopen(); because of (obvious) security reasons.
    This means that the front page remains empty as is discussed above.
    Is there another way to display the five recent records, without using fopen()?
    Surely the same information can be displayed by using show.php or show.js?
    For example by using the javascript (show.js) and the function showRefs()

     
  • because of (obvious) security reasons.

    Allow me to take issue with your use of the word "obvious" here.  fopen, by itself, is not insecure.  In this particular case, refbase is using fopen to retrieve a page from the very same server that you are hosting your refbase installation on.  If you don't trust that fopen connection, you can't trust your own server!  Note that the present version of refbase uses fopen for other things, including the download of reference information from remote databases (but, again, these are trusted sources).

    fopen can be and has certainly been abused (esp. if end-users are able to give it an input in someway), so I won't quibble with the decision of some admins from disabling it & it is planned to deprecate the use of the function by refbase.

    If file_get_contents() works on your server, you can modify the fetchDataFromURL function in includes/include.inc.php to use this instead.

     
  • heem
    heem
    2010-08-06

    I didn't want to start a debate about fopen(). My issue was just that I can't use it, so I need another way to get it done.
    In index.php changing the following line (406) from:
    $recentAdditionsResultTable = fetchDataFromURL($recentAdditionsQueryURL);
    to:
    $recentAdditionsResultTable = file_get_contents($recentAdditionsQueryURL);
    seems to work similarily. Don't yet know whether it is allowed or not.

    Can file_get_contents() be used in the DOI import problem aswell?
    As discussed in thread http://sourceforge.net/projects/refbase/forums/forum/218758/topic/3274100

     
  • Can file_get_contents() be used in the DOI import problem aswell?

    Probably.  This is why I encouraged you to modify the fetchDataFromURL() function (which differs from you replacing the call to fetchDataFromURL() with a call to file_get_contents()).

    Then, everything that called fetchDataFromURL() would probably work & you can still have consistent error handling.

    -Rick