Code Monkey home page Code Monkey logo

swap-space's Introduction

Swap Space

Bu rehberde sunucumuzu daha verimli kullanmak için swap space yapacağız.

Nedir bu swap space?

  • Öncelikle swap space ve benzeri konular için toplu ve büyük bir repo hazırladım ancak buna ihtiyaç olduğu için ayrı paylaşıyorum şimdilik.
  • Swap space, sunucularınızdaki RAM için bir yedek alan açmamız için yapılan bir işlem. Swap space, fiziksel RAM'in yetersiz olduğu durumlarda sistemin ihtiyaç duyduğu ek bellek alanını sağlamak için kullanacağız. RAM arttırırken diskten yiyoruz, ve burada kullanılan RAM fiziksel RAM kadar hızlı ve sağlıklı değil.
  • Sağlıklı değil? Yani.. benim 1TB diskim var, 100 GB RAM yapayım o zaman (yapabilirisniz) demek pek mantıklı değil, ihtiyaç kadarını kullanacağız.
  • Bu sayede sistem daha fazla veriyi aynı anda işleyebilir ve daha hızlı çalışabilir. Swap alanının boyutu genellikle sistem belleğinin RAM boyutuna göre ayarlanır ve genellikle birkaç gigabayt civarında.

Nasıl yapılır?

  • Ben örnekte 1 GB'lık RAM açacağım size (1024 MB), siz ihtiyacınız kadarınızı belirleyin.
  • Ziesha'da killed olanlar için 1 GB yeter yüksek ihtimal (test etmedim)
  • 1024 MB boyutunda bir swap dosyası oluşturmak için:
sudo swapoff -a
sudo fallocate -l 1024M /swapfile

Oluşturduğunuz swap dosyasının izinlerini ayarlamak için:

sudo chmod 600 /swapfile

Oluşturduğunuz swap dosyasını sisteme eklemek için:

sudo mkswap /swapfile

Oluşturduğunuz swap dosyasını aktif hale getirmek için:

sudo swapon /swapfile

Bu 3 komutlada kontrol edebilirsiniz:

sudo swapon -s
free -m
htop

image image

Silmek için:

sudo swapoff -a

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.