Academy and Foundation unixmens | Your skills, Your future
2.28K subscribers
6.65K photos
1.36K videos
1.23K files
5.97K links
@unixmens_support
@yashar_esm
unixmens@gmail.com
یک کانال علمی تکنولوژی
فلسفه متن باز-گنو/لینوکس-امنیت - اقتصاد
دیجیتال
Technology-driven -بیزینس های مبتنی بر تکنولوژی
Enterprise open source
ارایه دهنده راهکارهای ارتقای سازمانی - فردی - تیمی
Download Telegram
Bcache, cachefs and cachefilesd are three different caching solutions that can improve the performance of disk access. Bcache is a block-level cache that uses an SSD as a cache for another block device, such as a hard disk. Cachefs is a file-level cache that uses a directory on a local disk as a cache for network filesystems, such as AFS or NFS3. Cachefilesd is a daemon that manages the cachefs data store and communicates with the kernel module cachefiles. Some of the benefits of using bcache are:

It can speed up random read and write operations on slow disks by using fast SSDs as cache.
It can handle files that are larger than the cache size by caching partial extents.
It can protect data integrity by reliably handling unclean shutdowns and IO errors.
It can bypass the cache for sequential IO and large file copies to avoid cache pollution.
Some of the benefits of using cachefs and cachefilesd are:

They can reduce network traffic and latency by caching data locally on disk.
They can automatically adjust the cache size according to the available disk space and culling limits.
They can work with any network filesystem that supports FS-Cache, such as AFS or NFS.
They can hide IO errors that occur in the cache from the client filesystem driver.



https://lnkd.in/gneuxUSe


#linux #storage #yashar_esmaildokht #cachefs #zfs #bcache #kernel #cache
تغییر جدید در کرنل لینوکس (Linux) 6.13 می‌تواند مصرف انرژی دیتاسنتر (Data Center) را تا 30٪ کاهش دهد
کرنل لینوکس 6.13 با معرفی بهبودهای متعددی در زمینه مدیریت مصرف انرژی و کارایی سیستم، گام‌های مؤثری در راستای بهینه‌سازی عملکرد سرورها و دیتاسنترها برداشته است. در اینجا به برخی از تغییرات فنی کلیدی اشاره می‌کنم:

1. بهینه‌سازی در مدیریت CPU:

بهبود الگوریتم‌های خواب و بیداری: الگوریتم‌های جدید برای مدیریت حالت‌های خواب (sleep states) و بیداری (wake states) پردازنده‌ها به سیستم اجازه می‌دهند تا به طور هوشمندانه‌تر و سریع‌تر به بارهای کاری پاسخ دهد و در عین حال مصرف انرژی را کاهش دهد.

2. بهینه‌سازی در مدیریت حافظه:

تغییرات در تخصیص حافظه: تغییراتی در نحوه مدیریت حافظه و تخصیص آن به منظور کاهش مصرف انرژی انجام شده است. این شامل بهینه‌سازی‌هایی در الگوریتم‌های کش (cache) و نحوه دسترسی به حافظه است.

3. پشتیبانی از سخت‌افزار جدید:

افزودن پشتیبانی برای پردازنده‌های جدید: این نسخه از کرنل، پشتیبانی از پردازنده‌ها و چیپست‌های جدید که به طور خاص برای بهینه‌سازی مصرف انرژی طراحی شده‌اند، مانند پردازنده‌های ARM و x86 با ویژگی‌های بهینه‌سازی مصرف انرژی را اضافه کرده است.

4. مدیریت حرارت و تهویه:

بهبودهای مدیریت حرارت: تغییراتی در مدیریت حرارت انجام شده که می‌تواند به کاهش نیاز به تهویه مطبوع و در نتیجه کاهش مصرف انرژی کمک کند.

5. بهینه‌سازی درایورهای سخت‌افزاری:

بهبود درایورهای سخت‌افزاری: درایورهای سخت‌افزاری برای کارت‌های گرافیک و دیگر اجزای سیستم بهبود یافته‌اند تا مصرف انرژی در حالت‌های مختلف کاهش یابد.

6. مدیریت بار کاری (Workload Management):

الگوریتم‌های جدید توزیع بار کاری: این الگوریتم‌ها می‌توانند منجر به کاهش مصرف انرژی با استفاده بهینه از منابع موجود شوند.

7. پروتکل‌های جدید ارتباطی:

بهینه‌سازی پروتکل‌های ارتباطی: این تغییرات می‌تواند به کاهش تأخیر و افزایش کارایی کمک کند.

8. پارامتر جدید irq_suspend_timeout:

معرفی پارامتر NAPI جدید: نسخه 6.13 کرنل لینوکس یک پارامتر پیکربندی جدید به نام irq_suspend_timeout را معرفی کرده است که به بهینه‌سازی استفاده از پردازنده (CPU) و پردازش شبکه هنگام استفاده از IRQ deferral و NAPI busy poll کمک می‌کند. کارستن توضیح می‌دهد که اگر سروری دارای تعداد زیادی برنامه کوچک و چندکاربره (Multi-User, Multi-Process) باشد، این مکانیزم تأثیری بر عملکرد آن نخواهد داشت اما در عین حال مشکلی نیز ایجاد نمی‌کند.

بهینه‌سازی برای دیتاسنترها: در دیتاسنترها، معمولاً تعداد محدودی از برنامه‌های سرور تخصصی اجرا می‌شوند که هسته‌های خاصی از پردازنده‌ها را اشغال کرده و با صف‌های انتقال داده (Transmission Queues) در کارت شبکه (Network Interface Card - NIC) مرتبط هستند. مکانیزم جدید به بهینه‌سازی این نوع برنامه‌ها، به‌ویژه در سرورهای فرانت‌اند (Front-End Servers) و برخی از سرورهای بک‌اند (Back-End Servers) که داده‌ها را به فرانت‌اندها ارسال می‌کنند، کمک می‌کند.

تشخیص ترافیک شبکه: مکانیزم جدید کرنل لینوکس به‌صورت خودکار مقدار ترافیک شبکه را تشخیص داده و بین دو روش جابه‌جا می‌شود تا بهترین تعادل ممکن میان مصرف انرژی و کارایی به دست آید.

کاهش تداخل softIRQ: داماتو در Patch Cover Letter اشاره کرده است که این روش جدید کارایی را افزایش داده و از تداخل اجرای softIRQ با پردازش برنامه‌ها جلوگیری می‌کند. همچنین، این روش قابلیت ترکیب با epoll_wait را دارد تا در دوره‌های بیکاری، مصرف پردازنده (CPU Cycles) را کاهش دهد. این روش باعث می‌شود که عملکرد (شامل توان عملیاتی (Throughput) و زمان تأخیر (Latency)) به Polling Mode نزدیک باشد، در حالی که مصرف CPU تقریباً به اندازه Interrupt Mitigation پایین باقی بماند.

این تغییرات معمولاً در راستای افزایش کارایی و کاهش هزینه‌های عملیاتی دیتاسنترها طراحی شده‌اند. با توجه به اینکه مصرف انرژی یکی از بزرگ‌ترین چالش‌ها در اداره دیتاسنترها است، این تغییرات می‌توانند تأثیرات قابل توجهی بر روی هزینه‌ها و کارایی کلی سیستم‌ها داشته باشند.

#linux #kernel
https://t.me/unixmens
👍1
ebpf.pdf
837.4 KB
کتاب جدیدی که نوشتم تقدیم دوستان . این کتاب را بصورت آزاد منتشر کردم .

نویسنده : مهندس یاشار اسمعیل دخت

نکته : این کتاب نسخه : 0.1 میباشد .

#linux #kernel #yashar_esmaildokht #ebpf #bpf #cilium #network #security #k8s #kubernetes #openshift #openstack #hpc #sdn


https://t.me/unixmens
👍1🙏1
اپن استک (OpenStack) و کرنل لینوکس (Linux Kernel) دو پروژهٔ متن باز بزرگ و پیچیده هستند که از نظر حجم کد و منابع توسعه، در رده های بالایی قرار میگیرند. در زیر تحلیل دقیق تری ارائه میشود:

۱. حجم کد و پیچیدگی
- کرنل لینوکس:
- یکی از بزرگترین پروژه های متن باز جهان است. بر اساس گزارش ها، کرنل لینوکس (تا سال ۲۰۲۳) بیش از ۳۰ میلیون خط کد دارد.
- این حجم عظیم ناشی از پشتیبانی از سخت افزارهای متنوع، درایورها، سیستمهای فایل، شبکه، و بهینه سازی های عملکردی است.
- هر نسخه جدید کرنل توسط هزاران توسعه دهنده از شرکتهایی مانند Red Hat, Intel, Google, و IBM توسعه مییابد.

- اپن استک:
- یک اکوسیستم رایانش ابری شامل پروژههای مستقل مانند Nova (محاسبات)، Swift (ذخیرهسازی)، Neutron (شبکه)، و Horizon (داشبورد) است.
- حجم کل کد اپن استک به صورت تجمعی به دهها میلیون خط کد میرسد، اما هر کامپوننت به تنهایی کوچکتر از کرنل لینوکس است.
- پیچیدگی آن ناشی از ادغام سرویس های مختلف و نیاز به سازگاری با فناوری های ابری است.

۲. هزینه توسعه
- کرنل لینوکس:
- طبق مطالعه مؤسسه Linux Foundation (۲۰۲۱)، هزینه توسعه مجدد کرنل لینوکس از صفر، حدود ۱.۴ میلیارد دلار برآورد شده است.
- سالانه بیش از ۴۰ هزار کامیت توسط هزاران توسعه دهنده انجام میشود که نشان دهنده سرمایه گذاری عظیم انسانی و مالی است.

- اپن استک:
- هزینه توسعه آن به دلیل ماهیت توزیع شده و مشارکت سازمانهایی مانند IBM, Red Hat, و Canonical قابل توجه است، اما دقیقاً مشابه کرنل نیست.
- گزارشها نشان میدهند هزینه توسعه اپن استک ممکن است به صدها میلیون دلار برسد، اما به دلیل معماری ماژولار، سهم هر کامپوننت متفاوت است.

#openstack #kernel #market

https://t.me/unixmens
How we can update firmware in linux ?

Firmware is a specific type of software that is embedded into hardware devices. It provides low-level control for the device's specific hardware. Firmware is often stored in non-volatile memory (like ROM or flash memory) and is essential for the device to function correctly.
Characteristics:
Low-Level Software: Firmware operates close to the hardware level, managing the device's basic functions and operations.
Device-Specific: Each piece of hardware typically has its own firmware tailored to its specific functions and capabilities.



fwupdmgr is a cli tool associated with the fwupd project, which is designed to manage firmware updates on Linux systems. As for its future, several trends and developments can be anticipated:

Increased Hardware Support: As more manufacturers recognize the importance of firmware updates for security and performance, fwupd is likely to expand its support for a wider range of devices. This includes not only traditional components like motherboards and graphics cards but also peripherals, IoT devices, and other hardware.

Enhanced User Experience: The user experience for firmware updates may continue to improve, with better integration into desktop environments and more intuitive graphical interfaces. This could make it easier for users to manage updates without needing to rely solely on command-line tools.

Security Improvements: With the growing focus on cybersecurity, future versions of fwupd and fwupdmgr may implement more robust security features. This could include enhanced verification methods for firmware signatures, secure boot integration, and better handling of firmware vulnerabilities.

Collaboration with Manufacturers: As the open-source community collaborates more with hardware manufacturers, we may see more direct support and contributions from these companies to the fwupd project. This could lead to faster updates and more comprehensive firmware support.

Integration with System Management Tools: fwupdmgr may become more integrated with other system management tools and package managers, allowing for a more seamless experience when managing both software and firmware updates.

Community Contributions: The open-source nature of fwupd means that community contributions will continue to play a significant role in its development. As more developers get involved, we can expect innovative features and improvements to emerge.

Cross-Platform Expansion: While primarily focused on Linux, there may be efforts to extend fwupd capabilities to other operating systems, allowing for a more unified approach to firmware management across different platforms.

In summary, the future of fwupdmgr and the fwupd project looks promising, with potential advancements in hardware support, user experience, security, and collaboration with manufacturers. As the landscape of computing continues to evolve, tools like fwupdmgr will play a crucial role in ensuring that firmware remains up to date and secure.

fwupdmgr is a command-line tool used in Linux systems for managing firmware updates. It is part of the fwupd project, which provides a way to update the firmware of various hardware components, such as BIOS, UEFI, and peripheral devices, in a standardized manner.

Here are some common commands you can use with fwupdmgr:

Check for Updates:
fwupdmgr refresh

List Available Updates:
fwupdmgr get-updates


Install Updates:



fwupdmgr update


Show Current Firmware Version:



fwupdmgr get-devices


Perform a Firmware Update:



    fwupdmgr update


Make sure to run these commands with appropriate permissions (often as root or using sudo) to ensure that the firmware can be updated successfully. Always back up important data before performing firmware updates, as there is a risk of failure that could render hardware inoperable.


#linux #firmware #kernel #bash #tips #hardware #bios #uefi

https://t.me/unixmens/19265
#سوال ‌ چطور در iptables فیلتر براساس کشور انجام شود ؟

برای فیلتر کردن ترافیک بر اساس کشور در iptables، معمولاً از ماژول xt_geoip استفاده می‌شود. این ماژول به شما اجازه می‌دهد تا ترافیک را بر اساس آدرس‌های IP و کشور مبدا آن‌ها فیلتر کنید. در زیر مراحل کلی برای انجام این کار آورده شده است:
مراحل انجام کار:

نصب بسته‌های لازم:
ابتدا باید بسته‌های لازم را نصب کنید. در اکثر توزیع‌های لینوکس، می‌توانید از GeoIP و xtables-addons استفاده کنید. برای نصب آن‌ها، از دستورات زیر استفاده کنید:



sudo dnf install geoip geoip-devel xtables-addons

sudo apt install geoip-bin xtables-addons-common


دانلود و به‌روزرسانی پایگاه داده GeoIP:
شما باید پایگاه داده GeoIP را دانلود کنید. می‌توانید از دستور زیر استفاده کنید:



sudo geoipupdate


ایجاد پایگاه داده برای xt_geoip:
پس از دانلود پایگاه داده، باید آن را به فرمت مورد نیاز xt_geoip تبدیل کنید:



sudo mkdir -p /usr/share/xt_geoip
sudo geoipupdate -f /usr/share/xt_geoip/GeoIP.dat
sudo xt_geoip_build /usr/share/xt_geoip/GeoIP.dat


استفاده از iptables برای فیلتر کردن بر اساس کشور:
حالا می‌توانید از iptables برای فیلتر کردن ترافیک بر اساس کشور استفاده کنید. به عنوان مثال، برای مسدود کردن ترافیک از یک کشور خاص (مثلاً ایران)، می‌توانید از دستور زیر استفاده کنید:



sudo iptables -A INPUT -m geoip --src-cc IR -j DROP


در اینجا IR کد کشور ایران است. شما می‌توانید کد کشور مورد نظر خود را جایگزین کنید.

ذخیره تنظیمات iptables:
پس از انجام تغییرات، مطمئن شوید که تنظیمات iptables را ذخیره کنید تا پس از راه‌اندازی مجدد سیستم، اعمال شوند:



sudo iptables-save > /etc/iptables/rules.v4

نکات مهم:

اطمینان حاصل کنید که ماژول xt_geoip در هسته لینوکس شما فعال باشد.
پایگاه داده GeoIP ممکن است نیاز به به‌روزرسانی منظم داشته باشد تا اطلاعات جدیدترین IPها را شامل شود.
فیلتر کردن بر اساس کشور ممکن است به دلیل تغییرات IP و استفاده از VPNها و پروکسی‌ها همیشه دقیق نباشد.

با این مراحل، شما می‌توانید ترافیک را بر اساس کشور در iptables فیلتر کنید.

#firewall #linux #kernel #iptables

https://t.me/unixmens
در مورد قدرت لینوکس کمتر صحبت شده. بخشی از کتاب مرجع iptables را بصورت آزاد منتشر کردم . در گام بعد دوست دارم روی iproute2 صحبت کنم که ویژگی هایی ایجاد کرد که بازی را تغییر داد . (game changer بود - به طوری که سیسکو وnvidia روی لینوکس اومدن --> مراجعه کنید به cumulus LINUX ) و در گام بعد روی ویژگی جدید کرنل ebpf (قبلا مقاله ای برای اون نوشتم - که کاملش خواهم کرد . ) سعی خواهم کرد بنویسم . در این بین از مباحث devsecops خواهم گفت .


قبلا کم و بیش روی zebra کار کرده بودم . بعدا ادامه این پروژه zebra شد quaqa . که حرف و حدیث هایی توش هست که سیسکو ازش استفاده کرده .




اما کمتر بخشی روی قدرت کرنل و امکانات اون صحبت کرده . در واقع قدرت این بخش مستقیم روی بیزینس ها است . روی لبه تکنولوژی هست . روی تغییرات مارکت هست .


سعی خواهم کرد . بیشتر در این مورد بنویسم .


#kernel #linux
ZFS (Zettabyte File System) offers several RAID-like configurations, including ZRAID and DRAID, which provide different advantages for data storage and redundancy.
ZRAID
ZRAID is a term often used to describe the traditional RAID configurations available in ZFS, such as RAID-Z1, RAID-Z2, and RAID-Z3. These configurations allow for:
Data Redundancy: Protects against data loss due to disk failures. RAID-Z1 can tolerate one disk failure, RAID-Z2 can tolerate two, and RAID-Z3 can tolerate three.
Efficient Storage: Unlike traditional RAID, ZFS uses variable block sizes and can efficiently utilize disk space.
Self-Healing: ZFS checksums all data and can automatically repair corrupted data using redundant copies.
DRAID
DRAID (Distributed RAID) is a newer feature in ZFS that enhances the traditional RAID configurations by distributing parity and data across all disks in a pool. Key benefits include:
Improved Performance: DRAID can offer better performance during rebuilds and normal operations by distributing the workload across all disks.
Scalability: It allows for easier expansion of storage pools by adding new disks without significant performance degradation.
Reduced Rebuild Times: Since data and parity are distributed, the time taken to rebuild a failed disk is generally shorter compared to traditional RAID configurations.

ZRAID (RAID-Z)

ZRAID encompasses the various RAID-Z configurations in ZFS, which include:

RAID-Z1:
Configuration: Similar to RAID 5, it uses one parity block.
Fault Tolerance: Can withstand one disk failure.
Use Case: Suitable for environments where data redundancy is important but cost needs to be managed.

RAID-Z2:
Configuration: Similar to RAID 6, it uses two parity blocks.
Fault Tolerance: Can withstand two disk failures.
Use Case: Ideal for critical data storage where higher redundancy is required.

RAID-Z3:
Configuration: Uses three parity blocks.
Fault Tolerance: Can withstand three disk failures.
Use Case: Best for environments with very high data availability requirements.

Advantages of ZRAID:

Data Integrity: ZFS checksums all data, ensuring that any corruption can be detected and repaired.
Snapshots and Clones: ZFS allows for efficient snapshots and clones, which can be useful for backups and testing.
Compression: ZFS supports data compression, which can save space and improve performance.

Considerations for ZRAID:

Rebuild Times: In traditional RAID configurations, rebuilding a failed disk can take a significant amount of time, during which the system may be vulnerable to additional failures.
Performance: Write performance can be impacted due to the overhead of calculating parity.

DRAID (Distributed RAID)

DRAID is a more recent addition to ZFS, designed to address some of the limitations of traditional RAID configurations.
Key Features of DRAID:

Distributed Parity: Unlike ZRAID, where parity is concentrated, DRAID distributes parity across all disks, which can lead to improved performance.
Dynamic Resiliency: DRAID can adapt to changes in the storage pool, such as adding or removing disks, without significant performance penalties.
Faster Rebuilds: The distributed nature of DRAID allows for faster rebuild times since the workload is shared across multiple disks.

Advantages of DRAID:

Performance: DRAID can provide better read and write performance, especially in environments with high I/O demands.
Scalability: It is easier to scale storage by adding disks, as the system can dynamically adjust to the new configuration.



Conclusion


Both ZRAID and DRAID provide robust solutions for data storage, with ZRAID being more traditional and widely used, while DRAID offers modern enhancements for performance and scalability. The choice between them depends on specific use cases, performance requirements, and the desired level of redundancy.



#zfs #raid #linux #storage #kernel #data

https://t.me/unixmens
Firewalls are essential components in cybersecurity that control incoming and outgoing network traffic based on predetermined security rules. Firewalls can be categorized in several ways based on how they operate and where they are deployed.

Here’s a breakdown of types of firewalls:

🔹 1. Packet-Filtering Firewalls

How it works: Inspects packets (headers) and allows or blocks them based on IP addresses, ports, or protocols.

Layer: Network Layer (Layer 3)

Pros: Fast and simple

Cons: Doesn’t inspect payloads; limited protection against complex threats

🔹 2. Stateful Inspection Firewalls

How it works: Tracks the state of active connections and makes decisions based on the context of the traffic (e.g., TCP handshake).

Layer: Network & Transport Layers (Layer 3 & 4)

Pros: More secure than packet-filtering; tracks connection state

Cons: More resource-intensive than stateless filtering

🔹 3. Application-Level Gateways (Proxy Firewalls)

How it works: Acts as a proxy between users and the resources they access, inspecting the actual data (e.g., HTTP traffic).

Layer: Application Layer (Layer 7)

Pros: Deep inspection of traffic; can log and filter based on content

Cons: Slower performance; more complex to manage

🔹 4. Next-Generation Firewalls (NGFW)

How it works: Combines traditional firewall with advanced features like:

Deep Packet Inspection (DPI)

Intrusion Detection/Prevention (IDS/IPS)

Application awareness

User identity tracking


Layer: Multi-layer (3 to 7)

Pros: Advanced threat detection, modern security capabilities

Cons: Expensive; requires skilled admins

🔹 5. Circuit-Level Gateways

How it works: Monitors TCP handshakes and sessions without inspecting packet contents.

Layer: Session Layer (Layer 5)

Pros: Lightweight and fast

Cons: No payload inspection; can’t prevent content-based attacks

🔹 6. Cloud-Based Firewalls (Firewall-as-a-Service – FWaaS)

How it works: Centralized firewall delivered via the cloud, protects users and devices regardless of their location.

Use case: Remote workers, branch offices, hybrid clouds

Pros: Scalable, easy to deploy, no physical hardware

Cons: Internet dependency; trust in third-party provider

🔹 7. Web Application Firewalls (WAF)

How it works: Specifically filters, monitors, and blocks HTTP/S traffic to and from web applications.

Focus: Protects against OWASP Top 10 (e.g., SQLi, XSS)

Pros: Essential for modern web apps and APIs

Cons: Not a full replacement for a network firewall

🔹 8. Host-Based Firewalls

How it works: Software-based firewall installed on individual servers or endpoints.

Scope: Local to the host

Pros: Fine-grained control; protects even if the network firewall is bypassed

Cons: Must be configured on each host; hard to manage at scale

🔹 9. Virtual Firewalls

How it works: Deployed in virtual environments (e.g., VMware, KVM, OpenStack) to secure VM traffic.

Use case: Cloud and virtualized data centers

Pros: Agile, integrates with SDN and orchestration

Cons: Requires knowledge of virtual infrastructure

#security #firewall #linux #kernel
https://t.me/unixmens
ساختار bluestore و lvm در ceph :



این نکته را باید گفت که : ؛در Ceph و مشخصاً در BlueStore، استفاده از LVM یک گزینه است، نه یک الزام.؛


اما در ادامه به بررسی مزایا و معایب این روش خواهیم پرداخت :

در کل ما دو گزینه داریم در مبحث bluestore

استفاده از Raw Device (Default و توصیه‌شده)


در این حالت، BlueStore مستقیماً روی یک دیسک یا پارتیشن فیزیکی نصب می‌شود (مثلاً /dev/sdX).

هیچ LVM یا فایل‌سیستمی در بین نیست.

مزیت: عملکرد بهتر، تأخیر کمتر، و سادگی در مدیریت.

و روش دیگر LVM-Based OSD (معمولاً در Ceph-Ansible یا ceph-volume استفاده می‌شود)

در این حالت از Volume Group و Logical Volume (LVM) استفاده می‌شود.

مخصوصاً وقتی شما بخواهید فضای OSD را روی LVM پارتیشن‌بندی کنید یا چند دیسک کوچک را تجمیع نمایید.

در ابزار ceph-volume این حالت پرکاربرد است.

به صورت مثال:



ceph-volume lvm create --data /dev/sdX


یا برای ساخت دستی:

pvcreate /dev/sdX
vgcreate ceph-vg /dev/sdX
lvcreate -n osd-lv -l 100%FREE ceph-vg
ceph-volume lvm create --data ceph-vg/osd-lv



پس BlueStore چگونه کار می‌کنه بدون فایل‌سیستم؟

در واقع BlueStore داده‌ها را مستقیماً روی دستگاه بلاک (Block Device) می‌نویسد.

برای متادیتا و ساختار مدیریت داخلی خودش، از یک دیتابیس داخلی استفاده می‌کند که اغلب RocksDB است.

ساختار ذخیره‌سازی BlueStore:

        block: داده‌های اصلی

block.db: متادیتا

block.wal: write-ahead log


این‌ها یا روی همان دیسک یا روی دیسک‌های جداگانه می‌توانند قرار گیرند.
🔧 چرا این تصمیم گرفته شده؟

حذف فایل‌سیستم مانند XFS باعث شده:

یک لایه میانی کمتر شود (Overhead کمتر)

Ceph کنترل کامل روی داده‌ها و تخصیص داشته باشد

بتواند عملکرد و latency را بهینه کند

بهتر با SSD و NVMe سازگار شود

اما مزایای استفاده از lvm میتونه چی باشه ؟ !!!!!!


استفاده از LVM در BlueStore یک گزینه اختیاری اما بسیار مفید است، مخصوصاً در محیط‌های production. در ادامه، مزایا و دلایل اصلی استفاده از LVM در BlueStore را با هم بررسی میکنیم :


1. مدیریت منعطف دیسک‌ها

با LVM می‌توان از چند دیسک فیزیکی یک Volume Group ساخت و آن را به یک OSD اختصاص داد.

می‌توان ظرفیت را در آینده افزایش داد (extend) یا تنظیمات جدید اعمال کرد.

مناسب برای دیتاسنترهایی که مدیریت منابع ذخیره‌سازی به‌صورت داینامیک انجام می‌دهند.

2. پارتیشن‌بندی دقیق اجزای BlueStore (block, block.db, block.wal)

در BlueStore ما سه جزء کلیدی داریم که قبلا به اون پرداختم .


با LVM می‌توان این اجزا را روی دیسک‌های مختلف قرار داد تا
از SSD برای block.db و block.wal استفاده کرد

و از HDD برای block (داده حجیم)

این کار تأثیر چشم‌گیری در افزایش کارایی و کاهش latency دارد.
3. یکپارچگی با ابزار ceph-volume

در واقع ceph-volume ابزار رسمی Ceph برای مدیریت OSDها است و از LVM به‌صورت native پشتیبانی می‌کند.

مزایا:

ساخت آسان‌تر OSD

مانیتورینگ بهتر با ceph-volume lvm list

سازگاری با cephadm/ansible

بازیابی ساده‌تر در صورت crash

4. قابلیت Tag گذاری و مدیریت منطقی

با LVM می‌توان Volumeها را با تگ‌های مشخص تعریف کرد (مثلاً برای osd.12 یا nvme-db)

در سناریوهای Disaster Recovery یا Migration بسیار مفید است.

5. Snapshot و Backup سطح Volume (در برخی کاربردها)

هرچند برای OSD عملیاتی مرسوم نیست، اما در برخی سناریوهای تست و توسعه امکان گرفتن snapshot از OSD volume وجود دارد.

مثلاً قبل از upgrade.

6. درک و مشاهده ساختار دقیق با ابزارهای LVM

ابزارهایی مثل lvdisplay, vgdisplay, pvdisplay دید کاملی از وضعیت OSD می‌دهند.

تشخیص مشکلات و مدیریت ساده‌تر.

#ceph #lvm #linux #storage #kernel #sds #bluestore

https://t.me/unixmens
Academy and Foundation unixmens | Your skills, Your future
Photo
#دانستنی های #گنو/ #لینوکس :


در واقع Tuned در لینوکس یک سرویس و مجموعه ابزار برای بهینه‌سازی خودکار عملکرد و مصرف انرژی سیستم است که می‌تواند پروفایل‌های آماده یا سفارشی را روی سخت‌افزار اعمال کند.

ایده اصلی Tuned این است که بسته به سناریوی کاری (سرور دیتابیس، ماشین مجازی، لپ‌تاپ، سیستم گرافیکی، ذخیره‌سازی و غیره)، سیستم را به‌طور پویا بهینه کند، بدون اینکه کاربر هر بار دستی پارامترها را تغییر دهد.

این تنظیمات می‌توانند شامل:

CPU governor و فرکانس پردازنده

زمان‌بندی I/O (I/O scheduler)

تنظیمات شبکه (TCP stack)

سیاست مصرف انرژی دستگاه‌ها (PCIe ASPM، SATA link power)

تنظیمات kernel sysctl

پارامترهای NUMA و حافظه


توی دنیای لینوکس، tuned-ppd یک "دیمنت پیاده‌سازی پل" (compatibility daemon) است که برای همگام‌سازی دو سیستم مدیریت پروفایل مصرف انرژی طراحی شده:

تعریف و هدف tuned-ppd

ا tuned-ppd وظیفه دارد تا API مورد استفاده توسط power-profiles-daemon (PPD) را به API سیستم TuneD ترجمه کند



نحوه عملکرد

برنامه‌هایی که با API قدرت قبلی (PPD) کار می‌کردند، اکنون از طریق tuned-ppd به TuneD متصل می‌شوند.



برای نمونه : من در لپ تاپ خودم با این ابزار میتونم . تنظیم کنم . تا چند درصد باطری را شارژ کامل کنه . تا باطری عمر بیشتری داشته باشه .

نکته : این قابلیت ها سخت افزاری هستند وباید تولید کننده لپ تاپ این قابلیت را بده .


برای مثال : لپ‌تاپت من Lenovo Ideapad هست و با درایور ideapad_laptop کار می‌کنه.

این درایور فقط یک حالت conserve mode (روشن/خاموش) داره، یعنی:

0 → خاموش، باتری تا 100٪ شارژ میشه.

1 → روشن، باتری حداکثر تا حدود ~55–60٪ شارژ میشه (محدوده دقیق وابسته به مدل و firmware هست)


--- TLP 1.7.0 --------------------------------------------



+++ Battery Care

Plugin: lenovo

Supported features: charge threshold

Driver usage:

* vendor (ideapad_laptop) = active (charge threshold)

Parameter value range:

* STOP_CHARGE_THRESH_BAT0: 0(off), 1(on) -- battery conservation mode

اما tlp :



یک ابزار تخصصی مدیریت مصرف انرژی در لینوکس است که برخلاف Tuned که بیشتر روی بهینه‌سازی کلی سیستم (CPU، I/O، Network، Memory) تمرکز دارد، بیشتر تمرکزش روی بهینه‌سازی مصرف باتری و افزایش طول عمر آن است، مخصوصاً برای لپ‌تاپ‌ها.

هدف TLP این است که:

عمر باتری لپ‌تاپ را افزایش دهد (Battery Longevity)

زمان کارکرد روی باتری را بیشتر کند (Battery Runtime)

بدون نیاز به تغییر دستی تنظیمات، بهترین تعادل بین مصرف انرژی و کارایی را پیدا کند.

ا TLP بعد از نصب و فعال‌سازی، به‌صورت خودکار با توجه به وضعیت سیستم (وصل بودن به برق یا کار روی باتری) تنظیمات بهینه را اعمال می‌کند.


تنظیم CPU frequency scaling governor

تنظیم PCI Express ASPM برای کاهش مصرف برق قطعات PCIe

خاموش‌کردن پورت‌های USB در حالت بیکار (USB autosuspend)

خاموش یا کم‌کردن توان Wi-Fi و Bluetooth در حالت باتری

تنظیم پارامترهای SATA link power management

کنترل GPU power saving (برای Intel، NVIDIA و AMD)

مدیریت Battery charge thresholds (در لپ‌تاپ‌هایی که پشتیبانی می‌کنند، مثل Lenovo/Dell/ASUS)

تغییر تنظیمات kernel power management



unixmens

#linux #kernel #tlp #tuned #performance
#tune


https://t.me/unixmens