kevin-xw / rock-php

Automatically exported from code.google.com/p/rock-php
0 stars 0 forks source link

Performance fix for a large amount of objects #154

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to open a document with a a lot of embedded objects (say about 4000).

What is the expected output? What do you see instead?
Expected: A result page displayed in a reasonable amount of time.
Received: a 500 Internal Server Error due to a timeout.

Log is as follows:
[warn] [client ip] mod_fcgid: read data timeout in 40 seconds, referer: 
http://[server]/rockmongo/index.php?action=admin.dbs&db=db
[error] [client ip] Premature end of script headers: index.php, referer: 
http://[server]/rockmongo/index.php?action=admin.dbs&db=db
[warn] mod_fcgid: process 11923 graceful kill fail, sending SIGKILL
RockMongo Version: 1.1.0

Operation System: CentOS 4
PHP Version: 5.3.6
php_mongo Version: 1.2.2
MongoDB version: 1.8.2

The problem was resolved by altering the function "_exportPHP" in class 
VarExportor (app/classes/VarExportor.php) as follows:

       private function _exportPHP() {
                $var = $this->_formatVar($this->_var);
                $string = var_export($var, true);

                $params = array();
                foreach ($this->_phpParams as $index => $value) {
                        $params["'" . $this->_param($index) . "'"] = $value;
                }

                return strtr($string, $params);
        }

No functional regressions have been noticed to date.

Original issue reported on code.google.com by kelvin.w...@gmail.com on 1 Aug 2011 at 6:59

GoogleCodeExporter commented 9 years ago
da

Original comment by userg...@gmail.com on 3 Apr 2012 at 3:12

GoogleCodeExporter commented 9 years ago
Thank you, the codes replaced in SVN repository.

Original comment by iwind....@gmail.com on 4 May 2012 at 3:44