Skip to content

Instantly share code, notes, and snippets.

☢️
Feeling radiant 😎

Filip Sobalski pinkeen

☢️
Feeling radiant 😎
Block or report user

Report or block pinkeen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pinkeen
pinkeen / anecdotes.md
Last active Aug 21, 2019
DevOps/SysOps Fuckup Anecdotes
View anecdotes.md

Elasticsuite thesaurus fuckup / huge es logfiles

Elasticsuite synonimization feature (thesaurus) works like this:

  • For each synonimized keyword in user's search query and each synonym configured for this keyword add a match condition to the elasticsearch query that has the keyword string replaced with synonym.
  • For multiple synonymized keywords appearing in user's search query this will produce a separate match condition for each combination of each synonym of each keyword.
  • This means that the resulting elasticsearch query will basically grow geometrically with the number of synonymized keywords present in user's query as the number of conditions is roughly (keyword count)^(average number of synonyms).

What client did is they've configured a bunch of keywords with 40-80 synonyms each one. When somebody entered a search query that had 3 of them elasticsuite would produce an elasticsearch query (the raw JSON) that weighed ~1GB (sic!). Of course elasticsearch would fail to parse such query

@pinkeen
pinkeen / 01-README.md
Last active Jul 29, 2019
Patch Magento AMQP framework to prevent RabbitMQ blowing up with consumer jobs that require long processing
View 01-README.md

Patch Magento AMQP framework to prevent RabbitMQ blowing up with consumer jobs that require long processing

Rationale

The default AMQP settings have unlimited prefetch count - this means that the server will continue sending messages to the consumer as quickly as it can regardless of whether the client is actually reading the messages.

When consumer worker is processing a long running job it's not reading the socket, while RMQ is still sending - this causes the TCP buffer to be overflown and the connection dropped before the original job even had the chance of finishing, this has major stability implications:

@pinkeen
pinkeen / 001-STUFF.md
Last active Jul 29, 2019
Useful scripts, patterns and stuff
View 001-STUFF.md
@pinkeen
pinkeen / HOWTO.md
Last active Jun 10, 2019
Add Elasticsearch plugins to Magento Cloud docker container when running locally
View HOWTO.md

How to add Elasticsearch plugins to Magento Cloud local docker setup

Please see the Official Magento Cloud docs first.

This guide has been created because the environment service configuration setting for this does not work with local docker container setup.

  1. Install the project's composer dependencies

    This is needed so the docker directory is created and ece-tools installed.

@pinkeen
pinkeen / ViolationErrorNameTest.php
Last active Nov 12, 2016
Test for getting a violation error name from symfony validator's ConstraintViolation
View ViolationErrorNameTest.php
<?php
use PHPUnit\Framework\TestCase;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Validator\Validation;
use Symfony\Component\Validator\Constraints as Assert;
@pinkeen
pinkeen / PKGBUILD
Created Apr 12, 2015
osmc installer pkgbuild for ver 1.1.1
View PKGBUILD
# Maintainer: Sam G Nazarko <email@samnazarko.co.uk>
# Contributor: Luigi Ranghetti <ggranga@gmail.com>
pkgname=osmc-installer-bin
pkgver=1.1.1
pkgrel=1
pkgdesc="OSMC Installer allows you to install OSMC on a variety of devices."
url=http://osmc.tv
arch=(i686 x86_64)
license=(GPL)
You can’t perform that action at this time.