MYCSS

Показ дописів із міткою mysql. Показати всі дописи
Показ дописів із міткою mysql. Показати всі дописи

2026-03-29

Comparing Performance After Optimization in django-mariadb-vector

Since version v0.2.0, the 'django-mariadb-vector' library includes several optimization options. Here are the results from performance tests.
Performance results

Note: Performance was measured using 20,000 iterations (3 runs) in `tests/measure_performance.py`, with randomly generated vectors of dimension 3072.

Benefits 'orlson' vs 'json'

  • Up to ~20× faster compared to the standard `json` library on generate vector data
  • Up to ~8× faster compared to the standard `json` library on response vector data

Benefits of 'binary' on response vector data

  • Up to ~16× faster compared to the standard `json` library
  • About ~2× faster compared to `orjson`

Testing output

Warming for 3 seconds

decode_binary start testing...
binary: 1.8913245666384075 [1.9641265999525785, 1.8629208999918774, 1.846926199970767]

decode_orjson_str start testing...
json_str: 3.804304266697727 [4.095871299970895, 3.7040354000637308, 3.6130061000585556]

decode_json_str start testing...
json_str: 30.897333099972457 [30.78853879997041, 31.119306599954143, 30.784153899992816]
* decode binary is fastest than json in 16.34 times
* decode binary is fastest than orjson in 2.01 times
* decode orjson is fastest than json in 8.12 times

encode_orjson_str start testing...
orjson_str: 2.32788303331472 [2.455615399987437, 2.2925777999917045, 2.235455899965018]

encode_json_str start testing...
json_str: 51.04346506666237 [50.961705199908465, 50.88195970002562, 51.28673030005302]
* encode orjson is fastest than json in 21.93 times

Reference

2026-03-28

DEMO Django application of usage library 'django-mariadb-vector' (MariaDB Vector)

pip install django-mariadb-vector

📒 Django MariaDB Vector DEMO application 

A minimal demo project showing how to build article recommendations using vector similarity in Django with MariaDB as the database.

The app stores articles, embeds their content into vectors, and then finds similar articles based on vector distance.

🔗 Repo: https://github.com/lexxai/django-mariadb-vector-demo
🔗 Examples: https://github.com/lexxai/django-mariadb-vector-demo/tree/main/docs
🔗 Repo library: https://github.com/lexxai/django-mariadb-vector


Features

  • Django application using MariaDB as the primary database
  • Article model with text content
  • Vector-based similarity search for recommendations
  • Simple UI:
  • List of all articles
    • "Similar articles" view for a selected article
    • Admin interface to add and manage articles

2024-09-09

FreeBSD 14. Mail server POSTFIX and mariadb-client instead of mysql-client

Маю операційну систему FreeBSD 14.1-RELEASE у віртуальному середовищі Proxmox VE. 

Щойно оновив поштовий сервер з FreeBSD 13.1-RELEASE, і з'ясувалося що я не можу тепер встановити POSTFIX та mariadb-client одночасно, як це було раніше. Тому це нотатка мені як я  розв'язав цю проблему, щоб не наступати на ті самі граблі двічі.

Коли встановлено у Вас mariadb-server та mariadb-client на одному сервері, то при встановленні поштового сервера postfix як пакунок через pkg install postfix-mysql, або з портів з опцією MySQL.

postfix freebsd port, mysql option

 Вам буде пропоновано видалити mariadb-server та mariadb-client і встановити mysql-client.

2014-03-05

Dovecot, PostfixAdmin mysql alias domain

Завдання, до поштового домену додався додатковий домен - alias
У поштовій системі використовується зв'язка  postfix+dovecot+mysql для зручності адміністрування PosfixAdmin.

Dovecot


password_query = 
SELECT username as user, password FROM mailbox AS t1 LEFT JOIN \
 alias_domain AS t2 ON alias_domain='%d' AND t2.active='1' \
 WHERE local_part = '%n' AND (t1.domain="%d" OR t1.domain=t2.target_domain) \
 AND t1.active='1'


user_query =
SELECT   concat('/home/vmail/',maildir) AS home, \
   concat('/home/vmail/',maildir,'dovecot.sieve') AS sieve, \
   5000 AS uid, 5000 AS gid, concat('*:bytes=',floor(quota)) AS quota_rule \
   FROM mailbox AS t1 LEFT JOIN alias_domain AS t2 ON alias_domain='%d' AND t2.active='1' \
   WHERE local_part = '%n' AND (t1.domain="%d" OR t1.domain=t2.target_domain) \
   AND t1.active='1'

2012-02-03

Настирливих спамерів в black list IP і блокуємо їх в IPFW

Є: 
  • FreeBSD, 
  • Postfix,
  • Swatch - log analyze.
  • MySQL - database
  • IPFW - firewall 

Отже завдання як тільки в logfile pistfix's з'явився запис на подобі: 
Code:
Jul 10 15:43:52 mail postfix/smtpd[89997]: warning: Connection rate limit exceeded: 10 from unknown[62.213.112.69] for service smtp
Jul 10 15:43:52 mail postfix/smtpd[89997]: disconnect from unknown[62.213.112.69]
Коли забув ти рідну мову, біднієш духом ти щодня...
When you forgot your native language you would become a poor at spirit every day ...

Д.Білоус / D.Bilous
Рабів до раю не пускають. Будь вільним!

ipv6 ready