phpmemadmin icon indicating copy to clipboard operation
phpmemadmin copied to clipboard

Error to load page with data

Open madmis opened this issue 10 years ago • 24 comments

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?

madmis avatar Feb 09 '15 09:02 madmis

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.

benjamin-carl avatar Feb 10 '15 08:02 benjamin-carl

Memcached - 1.4.14 php memcache module PHP 5.6.5 Ubuntu 14.04

madmis avatar Feb 10 '15 11:02 madmis

see: https://github.com/clickalicious/phpMemAdmin/issues/7#issuecomment-73711575

dginat avatar Feb 10 '15 15:02 dginat

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.

benjamin-carl avatar Feb 10 '15 21:02 benjamin-carl

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

madmis avatar Feb 11 '15 06:02 madmis

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.

benjamin-carl avatar Feb 11 '15 07:02 benjamin-carl

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.

madmis avatar Feb 11 '15 07:02 madmis

Same error. Not opens data on localhost connection

seyfer avatar Feb 13 '15 09:02 seyfer

Same error too.

mvedie avatar Mar 10 '15 09:03 mvedie

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);
    }

hotrush avatar Apr 15 '15 17:04 hotrush

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

jhuet avatar Jul 30 '15 16:07 jhuet

Yeah, error still exists

seyfer avatar Jul 30 '15 16:07 seyfer

+1

mmodler avatar Feb 25 '16 20:02 mmodler

+1

szepeviktor avatar May 07 '16 12:05 szepeviktor

+1

sverdier avatar Aug 23 '16 19:08 sverdier

Hi, problem in Multiline values check my fix https://github.com/aaarkadev/Memcached.php/commit/094205f9c1198b872c5029b5c6816bd7a6cea344

aaarkadev avatar Dec 21 '16 08:12 aaarkadev

+1

Tanariel avatar Dec 28 '16 09:12 Tanariel

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

jhuet avatar Dec 28 '16 09:12 jhuet

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

aaarkadev avatar Dec 28 '16 13:12 aaarkadev

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

sbraaa avatar Dec 30 '16 12:12 sbraaa

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.

ArtyomVeselkov avatar Apr 27 '17 18:04 ArtyomVeselkov

unfortunately it doesn't solve the problem

sbraaa avatar Apr 28 '17 07:04 sbraaa

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

carltondickson avatar Dec 13 '17 13:12 carltondickson

@carltondickson https://github.com/hgschmie/phpmemcacheadmin

seyfer avatar Dec 13 '17 13:12 seyfer