Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error to load page with data #4

Open
madmis opened this issue Feb 9, 2015 · 24 comments
Open

Error to load page with data #4

madmis opened this issue Feb 9, 2015 · 24 comments
Assignees

Comments

@madmis
Copy link

madmis commented Feb 9, 2015

Try to load - index.php?action=4&host=127.0.0.1:11211

Result: 504 Gateway Time-out.

I have some data in memcache, but i think there is not a lot.
Can i limit data loading?

@benjamin-carl benjamin-carl self-assigned this Feb 10, 2015
@benjamin-carl
Copy link
Collaborator

Currently not. I will add a limit parameter today. I just need to check for a good implementation.

Can you please provide some environment information:

  • version of memcached
  • which client was used to write those data Memcached or Memcache Extension?)
  • PHP version
  • OS

Thank you.

@madmis
Copy link
Author

madmis commented Feb 10, 2015

Memcached - 1.4.14
php memcache module
PHP 5.6.5
Ubuntu 14.04

@dginat
Copy link

dginat commented Feb 10, 2015

see: #7 (comment)

@benjamin-carl
Copy link
Collaborator

I've updated Memcached.php just a few seconds ago. Try to update phpMemAdmin's composer dependencies (Memcached.php) - make sure to use >= v0.3.2

composer update

should do the trick.

@madmis
Copy link
Author

madmis commented Feb 11, 2015

I've updated to v0.3.2, but still have error.

When i restart memcache (memcache has no data), page is loaded. When memcache has data, page not loaded.

May be this can help you to define problem

echo "stats items" | nc 127.0.0.1 11211
STAT items:4:number 1
STAT items:4:age 36
STAT items:4:evicted 0
STAT items:4:evicted_nonzero 0
STAT items:4:evicted_time 0
STAT items:4:outofmemory 0
STAT items:4:tailrepairs 0
STAT items:4:reclaimed 0
STAT items:4:expired_unfetched 0
STAT items:4:evicted_unfetched 0
STAT items:5:number 3
STAT items:5:age 36
STAT items:5:evicted 0
STAT items:5:evicted_nonzero 0
STAT items:5:evicted_time 0
STAT items:5:outofmemory 0
STAT items:5:tailrepairs 0
STAT items:5:reclaimed 0
STAT items:5:expired_unfetched 0
STAT items:5:evicted_unfetched 0
STAT items:6:number 5
STAT items:6:age 231
STAT items:6:evicted 0
STAT items:6:evicted_nonzero 0
STAT items:6:evicted_time 0
STAT items:6:outofmemory 0
STAT items:6:tailrepairs 0
STAT items:6:reclaimed 0
STAT items:6:expired_unfetched 0
STAT items:6:evicted_unfetched 0
STAT items:7:number 1
STAT items:7:age 230
STAT items:7:evicted 0
STAT items:7:evicted_nonzero 0
STAT items:7:evicted_time 0
STAT items:7:outofmemory 0
STAT items:7:tailrepairs 0
STAT items:7:reclaimed 0
STAT items:7:expired_unfetched 0
STAT items:7:evicted_unfetched 0
STAT items:8:number 1
STAT items:8:age 231
STAT items:8:evicted 0
STAT items:8:evicted_nonzero 0
STAT items:8:evicted_time 0
STAT items:8:outofmemory 0
STAT items:8:tailrepairs 0
STAT items:8:reclaimed 0
STAT items:8:expired_unfetched 0
STAT items:8:evicted_unfetched 0
STAT items:9:number 1
STAT items:9:age 230
STAT items:9:evicted 0
STAT items:9:evicted_nonzero 0
STAT items:9:evicted_time 0
STAT items:9:outofmemory 0
STAT items:9:tailrepairs 0
STAT items:9:reclaimed 0
STAT items:9:expired_unfetched 0
STAT items:9:evicted_unfetched 0
STAT items:13:number 1
STAT items:13:age 230
STAT items:13:evicted 0
STAT items:13:evicted_nonzero 0
STAT items:13:evicted_time 0
STAT items:13:outofmemory 0
STAT items:13:tailrepairs 0
STAT items:13:reclaimed 0
STAT items:13:expired_unfetched 0
STAT items:13:evicted_unfetched 0
END

@benjamin-carl
Copy link
Collaborator

Pretty cool - with your data i can debug a bit better what happens. Try to dig into this problem as soon as I'm back home.

Currently not sure if the data differs from the response I get from my Memcached instance and some others I've tried while developing.

@madmis
Copy link
Author

madmis commented Feb 11, 2015

When i have time, i can try to debug Memcached.php, may be i can find problem.
if i find a problem, let you know.

@seyfer
Copy link

seyfer commented Feb 13, 2015

Same error. Not opens data on localhost connection

@mvedie
Copy link

mvedie commented Mar 10, 2015

Same error too.

@hotrush
Copy link

hotrush commented Apr 15, 2015

same error
Memcached version: 1.4.13
PHP version: 5.4.39-1~dotdeb.1 (cli) (built: Mar 22 2015 08:00:19)
OS: Debian GNU/Linux 7.8 (wheezy)

Fatal error: Maximum execution time of 300 seconds exceeded in
/usr/share/phpmemadmin/vendor/clickalicious/memcached.php/lib/Clickalicious/Memcached/Client.php
on line 1041



        // Dispatch command in some different ways ... depending on command ...
        fwrite($socket, $data);

        // Fetch while receiving data ...
        while ((!feof($socket))) {

            // Fetch Bytes from socket ...
            $buffer .= fgets($socket, self::SOCKET_READ_FETCH_BYTES);

            // Response max. 64 Bit value = 8 Bytes - We reed 256
Bytes at once so one round is definitive enough ;)
            if ($command === self::COMMAND_INCR || $command ===
self::COMMAND_DECR) {
                break;
            }

            foreach ($this->sigsEnd as $sigEnd) {
                if (preg_match('/^' . $sigEnd . '/imu', $buffer)) {
// GOING DOWN HERE <==============
                    break 2;
                }
            }
        }

        // Check if response is parseable ...
        if ($this->checkResponse($buffer) !== true) {
            throw new Exception(
                sprintf(
                    'Error "%s" while sending command "%s" to host "%s"',
                    $this->getLastResponse(),
                    $command,
                    $this->getHost() . ':' . $this->getPort()
                )
            );
        }

        // Parse the response and return result ...
        return $this->parseResponse($command, $buffer);
    }

@jhuet
Copy link

jhuet commented Jul 30, 2015

Hi, any luck on finding the source of the problem yet ?

@seyfer
Copy link

seyfer commented Jul 30, 2015

Yeah, error still exists

@mmodler
Copy link

mmodler commented Feb 25, 2016

+1

2 similar comments
@szepeviktor
Copy link

+1

@sverdier
Copy link

+1

@aaarkadev
Copy link

Hi, problem in Multiline values check my fix aaarkadev/Memcached.php@094205f

@Tanariel
Copy link

+1

@jhuet
Copy link

jhuet commented Dec 28, 2016

@aaarkadev thanks for the fix, could you make a PR so that @clickalicious eventually merges it ?

@aaarkadev
Copy link

if ini_get('memcached.compression_type') == 'fastlz' AND ini_get('memcached.compression_threshold') > SIZE of value page will hang.

@sbraaa
Copy link

sbraaa commented Dec 30, 2016

mmm it doesn't run even with aaarkadev patch..
any news about fix?

@ArtyomVeselkov
Copy link

ArtyomVeselkov commented Apr 27, 2017

Possibly have figured out, where is the problem:

  • application collects all data from memcache, so it takes some time to be grabbed
  • the logic of concatenating data is not rather optimized (small blocks of 256 bytes and 10 iterations with preg_match)
  • the main problem is that (for unknown reason) last fgets takes too much time (last portion from socket with terminated signal, e.g. \r\nEND)
    Possibly it is the issue with PHP...

The solution is to set timeout for opened socket:
root/lib/Clickalicious/PhpMemAdmin/App.php:2276

    protected function dumpEntries($host, $port, $namespace = null, $flat = false)
    {
        // Assume empty result
        $result = array();

        $client = $this->getMemcachedClient($host, $port, $this->getConfig()->timeout);

        // Fetch all keys and all values ...
        $client->timeout(1); # THIS LINE
        $allSlabs  = $client->stats(Client::STATS_TYPE_SLABS);

and

root/vendor/clickalicious/memcached.php/lib/Clickalicious/Memcached/Client.php:943

    public function connect($host, $port, $timeout = null)
    {
        $uuid = $this->uuid($host, $port);

        if ($timeout === null) {
            $timeout = $this->getTimeout();
        }

        // The error variables
        $errorNumber = null;
        $errorString = 'n.a.';

        if (isset(self::$connections[$this->getPersistentId()][$uuid]) === false) {
            if ($timeout !== null) {
                $connection = @fsockopen(
                    $host,
                    $port,
                    $errorNumber,
                    $errorString,
                    $timeout
                );
                socket_set_timeout($connection, $timeout); # THIS LINE
            } else {

Also it would be great, if DATA wouldn't load entire cache but only via limited portions.

@sbraaa
Copy link

sbraaa commented Apr 28, 2017

unfortunately it doesn't solve the problem

@carltondickson
Copy link

Data page is still hanging unfortunately even with the attempted patches offered.

Are there any other memcached GUIs available?

  • Have tried FastoNoSQL 1.10.0.0 but not showing me data once connected
  • Keylord only has a console interface

@seyfer
Copy link

seyfer commented Dec 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests